题库练习 The number on the board
← 上一题 下一题 →

A11154 | The number on the board

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

题目描述

Some natural number was written on the board. Its sum of digits was not less than $k$ . But you were distracted a bit, and someone changed this number to $n$ , replacing some digits with others. It's known that the length of the number didn't change.

You have to find the minimum number of digits in which these two numbers can differ.

输入格式

The first line contains integer $k$ ( $1<=k<=10^{9}$ ).

The second line contains integer $n$ ( $1<=n<10^{100000}$ ).

There are no leading zeros in $n$ . It's guaranteed that this situation is possible.

输出格式

Print the minimum number of digits in which the initial number and $n$ can differ.

输入输出样例

输入 #1
3
11
输出 #1
1
输入 #2
3
99
输出 #2
0
C++ 编辑器
输入
输出