PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#SP0000042. Liệt kê số nguyên tố (Prime Enumeration)
HỌC THEO LỘ TRÌNH
1 lộ trìnhBài tập thuộc lộ trình
Mục lục đề ⌄
Đang đọc
Liệt kê số nguyên tố (Prime Enumeration)
Prime Enumeration
Source: LQDOJ
Version: Phuoc Hung OJ Extended
Problem Statement
Given a positive integer , list all primes in the inclusive interval , in increasing order. The number is not prime.
Input
One line containing the positive integer .
Output
Print each prime in on a separate line; print no numbers if none exist.
Subtasks
- Subtask 1 (20 points): .
- Subtask 2 (30 points): .
- Subtask 3 (50 points): .
Examples
Input
10
Output
2
3
5
7
Explanation
In , the number is not prime and are composite. Thus are printed on four lines.