#AT1459. C - Buy an Integer
C - Buy an Integer
C - 购买整数
得分:$300$ 分
问题描述
高桥来到一个整数商店购买一个整数。
商店出售从$1$到$10^9$的整数。整数$N$的售价为$A \times N + B \times d(N)$日元(日本货币),其中$d(N)$是$N$的十进制表示的位数。
找出高桥可以用$X$日元购买的最大整数。如果无法购买任何整数,则输出$0$。
约束条件
- 输入中的所有值都是整数。
- $1 \leq A \leq 10^9$
- $1 \leq B \leq 10^9$
- $1 \leq X \leq 10^{18}$
输入
从标准输入中以以下格式给定:
输出
输出高桥可以购买的最大整数。如果无法购买任何整数,则输出$0$。
Sample Input 1
10 7 100
Sample Output 1
9
(翻译已死,有事烧纸)The integer is sold for yen, and this is the greatest integer that can be bought. Some of the other integers are sold for the following prices:
- yen
- yen
- yen
Sample Input 2
2 1 100000000000
Sample Output 2
1000000000
He can buy the largest integer that is sold. Note that input may not fit into a -bit integer type.
Sample Input 3
1000000000 1000000000 100
Sample Output 3
0
相关
在下列比赛中: