Problem4530--正规数的判定

4530: 正规数的判定

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 128 MiB

Description

如果一个整数的所有质因数不超过 lns="http://www.w3.org/1998/Math/MathML">5,则它被称为正规数(Regular Number)。

例如 lns="http://www.w3.org/1998/Math/MathML">60 是一个正规数,因为 lns="http://www.w3.org/1998/Math/MathML">60=2235lns="http://www.w3.org/1998/Math/MathML">1000 也是一个正规数,因为 lns="http://www.w3.org/1998/Math/MathML">1000=222555。前十五个正规数为:

1,2,3,4,5,6,8,9,10,12,15,16,18,20,24

给定一个正整数 lns="http://www.w3.org/1998/Math/MathML">n,请判定它是否是一个正规数。


提示:

质因数(prime factor)是指一个正整数的因数中为质数的那些数。

简单来说:
如果一个数 lns="http://www.w3.org/1998/Math/MathML">a 是质数,并且能整除另一个数 lns="http://www.w3.org/1998/Math/MathML">b,那么 lns="http://www.w3.org/1998/Math/MathML">a 就是 lns="http://www.w3.org/1998/Math/MathML">b 的一个质因数。

例如:30


步骤:

  1. 从最小的质数 2 开始试除:

    • lns="http://www.w3.org/1998/Math/MathML">30÷2=15(能整除,所以质因数里有 2)

  2. 15 不能被 2 整除,换下一个质数 3

    • lns="http://www.w3.org/1998/Math/MathML">15÷3=5(能整除,质因数里有 3)

  3. 5 已经是质数,结束。

结果:30=2*3*5

lns="http://www.w3.org/1998/Math/MathML" display="block">30=2×3×5

质因数为 2, 3, 5







Input

  • 单个整数:表示 lns="http://www.w3.org/1998/Math/MathML">n
  • 对于 lns="http://www.w3.org/1998/Math/MathML">30% 的数据,lns="http://www.w3.org/1998/Math/MathML">1n105
  • 对于 lns="http://www.w3.org/1998/Math/MathML">100% 的数据,lns="http://www.w3.org/1998/Math/MathML">1n109



Output

  • 如果 lns="http://www.w3.org/1998/Math/MathML">n 是正规数,输出 Regular Number
  • 如果不是,输出 Irregular Number

Sample Input Copy

60

Sample Output Copy

Regular Number

Source/Category