#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define rep(i, m, n) for(int i=int(m);i> n; ll low = 1; ll high = (int) 1.5e9; while (high - low > 1) { ll mid = (low + high) / 2; if (calc(mid) < n) { low = mid; } else if (calc(mid) > n) { high = mid; } else { cout << "YES" << endl; cout << mid << endl; return 0; } } if (calc(low) == n) { cout << "YES" << endl; cout << low << endl; return 0; } cout << "NO" << endl; return 0; }