#ABC146C. [ABC146C] Buy an Integer

[ABC146C] Buy an Integer

提示:该题测试数据补录中,暂不支持评测提交。

No testdata at current.

No submission language available for this problem.

题目大意

高桥来到一家整数商店购买整数。

商店出售从 11 到 10910^9 的整数。整数 NN 的售价为 A×N+B×d(N)A \times N + B \times d(N) 日元(日本货币),其中 d(N)d(N) 是 NN 的十进制符号的位数。

求高桥有 XX 日元时能买到的最大整数。如果买不到整数,则打印 00 。

10 7 100
9
2 1 100000000000
1000000000
1000000000 1000000000 100
0
1234 56789 314159265
254309

提示

制約

  • 入力は全て整数である。
  • 1 ≤ A ≤ 109 1\ \leq\ A\ \leq\ 10^9
  • 1 ≤ B ≤ 109 1\ \leq\ B\ \leq\ 10^9
  • 1 ≤ X ≤ 1018 1\ \leq\ X\ \leq\ 10^{18}

Sample Explanation 1

9 9 の値段は 10 × 9 + 7 × 1 = 97 10\ \times\ 9\ +\ 7\ \times\ 1\ =\ 97 円で、これが買うことのできる最大の整数です。 他の整数の値段の例をいくつかあげると - 10: 10 × 10 + 7 × 2 = 114 10:\ 10\ \times\ 10\ +\ 7\ \times\ 2\ =\ 114 円 - 100: 10 × 100 + 7 × 3 = 1021 100:\ 10\ \times\ 100\ +\ 7\ \times\ 3\ =\ 1021 円 - $12345:\ 10\ \times\ 12345\ +\ 7\ \times\ 5\ =\ 123485$ 円 です。

Sample Explanation 2

お店に売られている最大の整数を買うことができます。入力が 32 32 bit整数型に収まらないことがあることに注意してください。