Welcome   HUNAN NORMAL UNIVERSITY ACM/ICPC Judge Online
Home
FAQs
Problem Set
Practices
Online Contests
Major Exercises
OI Special
Judgement
Submit
Online Status
User Ranklist
Users
Register new
Login
Web Links
Hunan Normal University
College of Information Science and Engineering
判断是否幸运数
Time Limit: 1000ms, Special Time Limit:2500ms, Memory Limit:32768KB
Total submit users: 45, Accepted users: 32
Problem 10096 : No special judgement
Problem description
  输入一个无符号整数,判断该数是否为幸运数。
注:从自然数序列:
   
 1,2,3,4,5,6,7,8,9,10,…
中的第2项开始,隔1个取走1个,得序列:
   
 1,3,5,7,9,11,13,15,…
 
再从其第3项开始,隔2个取走1个,得序列:
   
 1,3,7,9,13,15,19,…
 
按以上规律不断继续下去,永远取不走的数称幸运数。

Input
  有多组数据,每组数据占一行,为无符号整数n(n≤10000),输入最后一行是一个0,表示输入结束并且不需要处理。


Output
  判断n是否为幸运数。
若是,则输出:Yes,it is.
否则,输出: No it isn't.


Sample Input
20
7
0
Sample Output
No,it isn't.
Yes,it is.
Problem Source
  Teacher yxl 

Submit   Discuss   Judge Status  Problems  Ranklist 

HUNAN NORMAL UNIVERSITY ACM/ICPC Judge Online, Version 2010.5.5.final.
Web visits:707 today,12609605 total, since 2010-05-07