시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
1 초 | 1024 MB | 272 | 225 | 208 | 82.540% |
Consider a positive integer a. We define weight of a as:
(number of digits in a) * (sum of the digits in a)
For example, if a = 5767, then weight of a is:
(4) * (5 + 7 + 6 + 7) = 100
Given two positive integers, determine which one weighs more, i.e., it is heavier.
There is only one input line; it contains two integers separated by exactly one space (blank). Assume each integer is between 1 and 1,000,000 (inclusive).
Print 1 (one) if the first number is heavier, 2 (two) if the second number is heavier, and 0 (zero) if the two numbers weigh the same.
59 1001
1
8 567
2
123 90
0