请各位帮忙看看,谢谢了
#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e9+10;
int n,cnt,day = 1,tar,j;
bool vis[maxn];
int main(){
freopen("apple.in","r",stdin);
freopen("apple.out","w",stdout);
ios::sync_with_stdio(false);
cin.tie(0);
cin>>n;
int i = 0;
while(cnt < n){
i++;
if(i > n){
day++;
i = 1;
j = 0;
}
if(vis[i])
continue;
j++;
if(j % 3 == 1){
vis[i] = true;
cnt++;
if(i == n) tar = day;
}
}
cout<<day<<" "<<tar<<endl;
}