2409: 【普及-】【P1591】阶乘数码

内存限制:128 MB 时间限制:1.000 S
评测方式:文本比较 命题人:
提交:1 解决:1

题目描述

求 lns="http://www.w3.org/1998/Math/MathML">! 中某个数码出现的次数。

输入

第一行为 lns="http://www.w3.org/1998/Math/MathML">(10),表示数据组数。接下来 lns="http://www.w3.org/1998/Math/MathML"> 行,每行一个正整数 lns="http://www.w3.org/1998/Math/MathML">(1000) 和数码 lns="http://www.w3.org/1998/Math/MathML">

输出

对于每组数据,输出一个整数,表示 lns="http://www.w3.org/1998/Math/MathML">! 中 lns="http://www.w3.org/1998/Math/MathML"> 出现的次数。

样例输入 复制

2
5 2
7 0

样例输出 复制

1
2