#include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; typedef pair P; #define MOD 1000000007 // 10^9 + 7 #define INF 1000000000 // 10^9 #define LLINF 1LL<<60 ll A, B, C; // 10^k <= n < 10^k+1 int digit(ll n) { int res = 0; while (n > 0) { n /= 10; res++; } return res - 1; } // n年までにもらえる総額がCより多いかどうか bool money(ll n) { if (digit(n / A) + digit(B) >= 18) return true; else { ll tmp = (n / A)*B + n - (n / A); return tmp >= C; } } int main() { cin.tie(0); ios::sync_with_stdio(false); cin >> A >> B >> C; // left < ans <= right ll left = -1; ll right = C; while (left + 1 != right) { ll mid = (left + right) / 2; if (money(mid)) right = mid; else left = mid; } cout << right << endl; return 0; }