PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#SP0000001. Kiểm tra số nguyên tố (Primality Test)
HỌC THEO LỘ TRÌNH
1 lộ trìnhBài tập thuộc lộ trình
Mục lục đề ⌄
Đang đọc
Kiểm tra số nguyên tố (Primality Test)
Primality Test
Source: AtCoder
Version: Phuoc Hung OJ Extended
Problem Statement
A prime number is an integer greater than with exactly two positive divisors, and itself. Given an integer , determine whether is prime.
Input
One line containing the integer .
Output
Print Yes if is prime; otherwise print No.
Subtasks
- Subtask 1 (20 points): .
- Subtask 2 (30 points): .
- Subtask 3 (50 points): .
Examples
Input
53
Output
Yes
Explanation
The input integer is . It has no divisor other than and itself, so it is prime. Therefore the output is Yes.
Input
77
Output
No
Explanation
The input integer is . It has a proper divisor, so it is not prime. Therefore the output is No.