#include #include using namespace std; int main() { int v,t,p; cin >> v >> t >> p; int s = 0; int w = 0; int snr = 0; while (w < v) { w++; s++; if (snr > 0){ snr--; } if (w == v && p > 0) { p--; w = 0; } else if (snr == 0){ snr = t; w--; } for (int i = 9; i > 2; i--) { int thr = pow(10,i); if(v - w > thr && snr > thr) { w += thr; s += thr; snr -= thr; } } } cout << s; return 0; }