2166. Divisibility

单点时限: 2.0 sec

内存限制: 256 MB

On the planet Zoop, numbers are represented in base 62, using the digits 0, 1, . . . , 9, A, B, . . . , Z, a, b, . . . , z where

A (base 62) = 10 (base 10)

B (base 62) = 11 (base 10)

z (base 62) = 61 (base 10).

Given the digit representation of a number x in base 62, your goal is to determine if x is divisible by 61.

输入格式

The input test file will contain multiple cases. Each test case will be given by a single string containing only the digits ‘0’ through ‘9’, the uppercase letters ‘A’ through ‘Z’, and the lowercase letters ’a’ through ’z’. All strings will have a length of between 1 and 10000 characters, inclusive. The end-of-input is denoted by a single line containing the word “end”, which should not be processed.

输出格式

For each test case, print “yes” if the number is divisible by 61, and “no” otherwise.

样例

Input
1v3
2P6
IsThisDivisible
end
Output
yes
no
no
Hint:
In the first example, 1v3 = 1 × 62^2 + 57 × 62 + 3 = 7381, which is divisible by 61.
In the second example, 2P6 = 2 × 62^2 + 25 × 62 + 6 = 9244, which is not divisible by 61.

27 人解决,47 人已尝试。

29 份提交通过,共有 108 份提交。

5.4 EMB 奖励。

创建: 17 年,2 月前.

修改: 7 年,3 月前.

最后提交: 2 年,7 月前.

来源: Stanford Local 2007

题目标签