D. 考你初中知识

    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

可乐加冰有n栈电灯泡,编号为1-n,每个灯泡都有一个开关。那么问题来了 1.所有灯泡初始时为不亮的 2.可乐加冰分别进行三次操作 3.每次操作他都选一个质数x,将编号为x和x的整数倍的灯泡的开关都拨动一下(如果灯为亮,那么拨动以后灯为不亮,如果灯不亮,拨动以后变为亮)

求最后亮着的灯的数量

Format

Input

每组第一行一个n表示灯泡个数(1<=n<=10^9)

第二行三个数a,b,c表示可乐加冰每次选择的数(1<=a,b,c<=10^6)(a,b,c全为质数且a,b,c两两互不相等)

Output

求最后亮着的灯的数量

Samples

30
2 3 5
15

Limitation

1s, 1024KiB for each test case.

2022-2023学年周赛(10)暨蓝桥杯训练赛

Not Attended
Status
Done
Rule
ACM/ICPC
Problem
6
Start at
2023-3-5 8:30
End at
2023-3-5 12:00
Duration
3.5 hour(s)
Host
Partic.
32