AT_past202212_k 整数屋さん
Description
Takahashi wants an integer, so he goes to an integer shop.
The integer shop sells every integer between $ 1 $ and $ 10^9 $ , inclusive. The integer $ n $ is sold for $ A \times n + B \times d(n) $ yen (the currency in Japan), where $ d(n) $ denotes the sum of digits in the decimal notation of $ n $ .
Takahashi has $ X $ yen. Find the maximum integer he can buy.
Input Format
The input is given from Standard Input in the following format:
> $ A $ $ B $ $ X $
Output Format
Print the answer.
Explanation/Hint
### Sample Explanation 1
Since the integer $ 12 $ is sold for $ A \times 12 + B \times 3 = 48 $ yen and $ 48 \leq X = 50 $ , he can buy it.
We can show that the price of any integer greater than or equal to $ 13 $ is greater than $ X $ , so the maximum integer he can buy is $ 12 $ .
### Constraints
- $ 1 \leq A, B \leq 10^9 $
- $ A + B \leq X \leq 10^{18} $
- All values in the input are integers.