21 lines
402 B
C++
21 lines
402 B
C++
#include <iostream>
|
|
#include <vector>
|
|
using namespace std;
|
|
int main(){
|
|
int n;
|
|
cin >> n;
|
|
vector<int> a(n - 1, 0);
|
|
a.push_back(1);
|
|
int idx = 0;
|
|
int js = 0;
|
|
int p;
|
|
while(!a.empty()){
|
|
if(idx >= n) idx = 0;
|
|
if(a[idx] == 1) p = js;
|
|
a.erase(a.begin() + idx);
|
|
idx = idx + 2;
|
|
js++;
|
|
}
|
|
cout << js << " " << p << endl;
|
|
return 0;
|
|
} |