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

建议使用的浏览器:

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

6835:Divisibility

题目描述
You are given two $10$-based integers $b$ and $x$, and you are required to determine the following proposition is true or false:

For arbitrary $b$-based positive integer $y = \overline{c_1 c_2 \cdots c_n}$ ($c_i$ is the $i$-th dight from left of $y$), define $\displaystyle f(y) = \sum_{i=1}^n c_i$, if $\underbrace{f( f( \cdots f(y) \cdots ))}_{\infty}$ can be divided by $x$, then $y$ can be divided by $x$, otherwise $y$ can't be divided by $x$.
输入解释
The first line contains a $10$-based integer $t\ (1 \leq t \leq 10^5)$ — the number of test cases.

For each test case, there is a single line containing two $10$-based integers $b$ and $x \ (2 \leq b,x \leq 10^{18})$.
输出解释
For each test case, if the proposition is true, print "T", otherwise print "F" (without quotes).
输入样例
1
10 3
输出样例
T
来自杭电HDUOJ的附加信息
Recommend IceyWang

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

源链接: HDU-6835

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

共提交 0

通过率 --%
时间上限 内存上限
2000/1000MS(Java/Others) 65536/65536K(Java/Others)