题库练习 Really Big Numbers
← 上一题 下一题 →

A11019 | Really Big Numbers

时间限制1s
内存限制256MB
通过 / 提交0/0

题目描述

Ivan likes to learn different things about numbers, but he is especially interested in really big numbers. Ivan thinks that a positive integer number $x$ is really big if the difference between $x$ and the sum of its digits (in decimal representation) is not less than $s$ . To prove that these numbers may have different special properties, he wants to know how rare (or not rare) they are — in fact, he needs to calculate the quantity of really big numbers that are not greater than $n$ .

Ivan tried to do the calculations himself, but soon realized that it's too difficult for him. So he asked you to help him in calculations.

输入格式

The first (and the only) line contains two integers $n$ and $s$ ( $1<=n,s<=10^{18}$ ).

输出格式

Print one integer — the quantity of really big numbers that are not greater than $n$ .

输入输出样例

输入 #1
12 1
输出 #1
3
输入 #2
25 20
输出 #2
0
输入 #3
10 9
输出 #3
1
C++ 编辑器
输入
输出