CF817C.Really Big Numbers

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Ivan likes to learn different things about numbers, but he is especially interested in really big numbers. Ivan thinks that a positive integer number xx is really big if the difference between xx and the sum of its digits (in decimal representation) is not less than ss . 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 nn .

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 nn and ss ( 1<=n,s<=10181<=n,s<=10^{18} ).

输出格式

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

输入输出样例

  • 输入#1

    12 1
    

    输出#1

    3
    
  • 输入#2

    25 20
    

    输出#2

    0
    
  • 输入#3

    10 9
    

    输出#3

    1
    

说明/提示

In the first example numbers 1010 , 1111 and 1212 are really big.

In the second example there are no really big numbers that are not greater than 2525 (in fact, the first really big number is 3030 : 303>=2030-3>=20 ).

In the third example 1010 is the only really big number ( 101>=910-1>=9 ).

首页