当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

5657:CA Loves Math

题目描述
CA loves math.
In math class, the math teacher asks a question:
"How many 3-digit number which is multiple of 2 and the figures included do not repeat?"
CA thinks it's Too Simple, so he is thinking another harder question:
"How many number in $[1,A^n]$ which is multiple of $k$ and the figures included do not repeat(represented by A-ary)?"
输入解释
First line contains $T$ denoting the number of testcases.
$T$ testcases follow. Each testcase contains three intergers $A,n,k$ in one line.
$1 \le T \le 20,~2 \le A \le 11,~0 \le n \le 10^9,~1 \le k \le 10^9$
输出解释
For each testcase, output the answer in one line.
输入样例
2
10 2 7
11 2 3
输出样例
13
30

提示
In the first testcase, the number which meet the conditions are {7,14,21,28,35,42,49,56,63,70,84,91,98}.
来自杭电HDUOJ的附加信息
Recommend wange2014

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-5657

最后修改于 2020-10-25T23:24:34+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
10000/5000MS(Java/Others) 524288/524288K(Java/Others)