10333: 寿司晚宴

Memory Limit:10 MB Time Limit:1.000 S
Judge Style:Text Compare Creator:
Submit:1 Solved:0

Description

Input

Output

Sample Input Copy

10 10
3017196125
23051791739
1488181848717
197137375
3017196127
23051791739
197137372
3017196127
10519294081028
459742150225

Sample Output Copy

3
4
7
2
3
4
2
3
9
6

HINT

N<=10^7

Q<=10^5