PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#SP0000197. Ông Azad và con trai (Mr. Azad and his Son)
HỌC THEO LỘ TRÌNH
1 lộ trìnhBài tập thuộc lộ trình
Mục lục đề ⌄
Đang đọc
Ông Azad và con trai (Mr. Azad and his Son)
Mr. Azad and his Son
Phuoc Hung OJ ID: PRIME000202
Source: UVa 10490 (PHOJ Extended, one input instance per run).
Problem statement
Given , consider . If is a perfect number, print it in the exact required format. Otherwise print the exact status message depending on whether is prime or composite.
Input
One integer .
Output
For a perfect value print Perfect: P!. If is prime but produces no perfect number, print Given number is prime. But, NO perfect number is available.. Otherwise print Given number is NOT prime! NO perfect number is available.
Subtasks
- Subtask 1 (20 points): .
- Subtask 2 (30 points): .
- Subtask 3 (50 points): .
Example
Input
6
Output
Given number is NOT prime! NO perfect number is available.
Explanation: Since 6 is composite, the required output is the exact non-prime status sentence.