304284: CF817C. Really Big Numbers
Memory Limit:256 MB
Time Limit:1 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
Really Big Numbers
题意翻译
统计从 $1$ 到 $n$ 中有几个数减去其各数位之和后大于等于 $s$。题目描述
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