PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN

#SP0000259. Số Carmichael (Carmichael Numbers)

HỌC THEO LỘ TRÌNH

Bài tập thuộc lộ trình

1 lộ trình

Số Carmichael (Carmichael Numbers)

Carmichael Numbers

Source: UVa

Version: Phuoc Hung OJ Extended

Problem Statement

A programmer is investigating a primality test for a cryptographic application. Fermat’s theorem says that if nn is prime, then an≡a(modn)a^n\equiv a\pmod n for every integer aa.

Some composite integers nevertheless satisfy this congruence for every integer aa. Such integers are called Carmichael numbers.

Given a positive integer nn, determine whether it is a Carmichael number. Prime numbers are not Carmichael numbers even though they satisfy Fermat’s congruence.

Input

One line containing the integer nn.

Output

  • If nn is a Carmichael number, print The number n is a Carmichael number., replacing n with the input integer.
  • Otherwise, print n is normal., replacing n with the input integer.

Letter case, spaces, and the final full stop must match exactly.

Subtasks

  • Subtask 1 (20 points): 3≤n≤10003\le n\le1000.
  • Subtask 2 (30 points): 3≤n≤100003\le n\le10000.
  • Subtask 3 (50 points): 3≤n≤649993\le n\le64999.

Examples

Example 1

Input

1729

Output

The number 1729 is a Carmichael number.

Explanation

1729=7⋅13⋅191729=7\cdot13\cdot19 is square-free and 6,12,186,12,18 all divide 17281728. By Korselt’s criterion, it is a Carmichael number.

Example 2

Input

17

Output

17 is normal.

Explanation

1717 is prime. A Carmichael number must be composite, so it is normal.

Example 3

Input

561

Output

The number 561 is a Carmichael number.

Explanation

561=3⋅11⋅17561=3\cdot11\cdot17 is square-free. The values 2,10,162,10,16 all divide 560560, so 561561 is Carmichael.

Example 4

Input

1109

Output

1109 is normal.

Explanation

11091109 has no prime divisor at most ⌊1109⌋=33\lfloor\sqrt{1109}\rfloor=33, so it is prime and therefore not a Carmichael number.