#include #include using namespace std; int main() { long long n,m, N = 0, Tmin = 0, Tmax, ctr1 = 0, ctr2 = 0; cin >> n; m = n; Tmax = n - 1; while (n != 1) { N = n / 2; n = N; Tmin++; if (n == 1)break; if (n % 2 != 0) { Tmin += n - 1; ctr1 = 1; break; } } if(1) { n = m; if (n < 5000) { for (int i = 2; i < 5000; i ++) { if (pow(i, 3) == n) { cout << (i - 1) * 3 << " " << Tmax << endl; ctr2 = 1; break; } } } else if (n >= 5000) { for (int i = 5000; i <= 10000; i++) { if (pow(i, 3) == n) { cout << (i - 1) * 3 << " " << Tmax << endl; ctr2 = 1; break; } } } else if(ctr2==0){ if (n < 10000) { for (int i = 2; i < 10000; i++) { if (pow(i, 2) == n) { cout << (i - 1) * 2 << " " << Tmax << endl; ctr2 = 1; break; } } } else if (n >= 20000) { for (int i = 20000; i <= 30000; i++) { if (pow(i, 2) == n) { cout << (i - 1) * 2 << " " << Tmax; ctr2 = 1; break; } } } } } if (ctr1 == 1 && ctr2 == 0) { if (m % 2 == 0)cout << Tmin << " " << Tmax << endl; else cout << Tmax << " " << Tmax << endl; } return 0; }