#A. 再求素数

    Type: Default 1000ms 256MiB

再求素数

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

Description

程序细节:如何不超时! 合理使用break; 尽量让循环少运算; 输出 从2 到n 之间 所有的素数。 如果n也是,也输出n。

Input Format

一个整数n n<=1000000

Output Format

多行数据,每行一个素数,从小到大顺序输出。

Sample

input

10

output

2
3
5
7

Hint

保证n106n\leq 10^6

时间限制:1s1 \text {s}

空间限制:256MB256 \text {MB}

20221123--模拟赛

Not Attended
Status
Done
Rule
OI
Problem
4
Start at
2022-11-23 7:40
End at
2022-11-23 12:00
Duration
4.3 hour(s)
Host
Partic.
25