http://noi.openjudge.cn/ch0402/2419/
描述
Snoopy has three coins. One day he tossed them on a table then and tried to flip some of them so that they had either all heads or all tails facing up. After several attempts, he found that regardless of the initial configuration of the coins, he could always achieve the goal by doing exactly two flippings, under the condition that only one coin could be flipped each time and a coin could be flipped more than once. He also noticed that he could never succeed with less than two flippings.
Snoopy有三枚硬币。一天他吧它们投到桌子上然后尝试从它们当中翻转一些来让他能使所有硬币背面或正面朝上。几次尝试之后,他发现无论最初的硬币情况是什么,他总能通过两次翻转达到目的,在这个条件下一枚硬币每次只能翻转一次并且一个硬币能翻转多次。他还注意到,他不可能在不到两次的情况下成功。
Snoopy then wondered, if he had n coins, was there a minimum number x such that he could do exactly x flippings to satisfy his requirements?
Snoopy想知道,如果他有n枚硬币,是否有一个最小的数字x,这样他就可以准确地翻转x次来满足他的要求?
输入
The input contains multiple test cases. Each test case consists of a single positive integer n (n < 10,000) on a separate line. A zero indicates the end of input and should not be processed.
输入包含多个测试用例。每个测试用例由单独一行上的一个正整数n(n<10000)组成。零表示输入结束,不应进行处理。
输出
For each test case output a single line containing your answer without leading or trailing spaces. If the answer does not exist, output “No Solution!
”
对于每个测试用例,输出包含答案的单行,不带前导或尾随空格。如果答案不存在,则输出“No Solution
!”