- duanjiajun's blog
 【23CSPJ普及组】
- @ 2024-7-12 20:49:49
 
小苹果(apple)
#include <bits/stdc++.h>
using namespace std;
long long n, ans1, ans2, cnt;
bool dafen = false;
int main() {
    cin >> n;
    long long nn = n;
    while(nn) {
        ans1++;
        if (!dafen && nn % 3 == 1) {
            ans2 = ans1;
            dafen = true;
        }
        cnt = ceil(1.0 * nn / 3);
        nn -= cnt;
    }
    cout << ans1 << " " << ans2 << endl;
    return 0;
}