2018-2019 ICPC Southwestern European Regional Programming Contest (SWERC 2018)

A - City of LightsGym - 102465AParis has been called "ville lumière" (city of lights) since the 17th century. It earned this nickname in part because of the many city lights illuminating famous sites such as monuments, statues, churches, or founta...
摘要由CSDN通过智能技术生成

 

A - City of Lights

 Gym - 102465A 

Paris has been called "ville lumière" (city of lights) since the 17th century. It earned this nickname in part because of the many city lights illuminating famous sites such as monuments, statues, churches, or fountains.

Those public lights in Paris are numbered from 11 to NN and are all on by default. A group of hackers has gained the capability to toggle groups of lights. Every time the hackers use their program, they cause a number ii (that they cannot control) to be sent to the system controlling the city lights. The lights numbered ii, 2i2i, 3i3i, and so on (up to NN) then change state instantly: lights that were on go off, and lights that were off go on.

During the night, the hackers use their programs kk times. What is the greatest number of lights that are simultaneously off at the same time?

Input

The input comprises several lines, each consisting of a single integer:

  • The first line contains the number NN of lights. 1≤N≤10000001≤N≤1000000.
  • The second line contains the number kk of uses hackers's program. 1≤k≤1001≤k≤100.
  • The next kk lines contain a number ii sent to the system controlling the lights. 1≤i≤N1≤i≤N.

 

Output

The output should consist of a single line, whose content is an integer, the greatest number of lights that are simultaneously off at the same time.

Example

Input

10
4
6
2
1
3

Output

6

Note

Sample Explanation:

We start with a group of 10 lights which are all on.

The hackers send the number 6: light 6 is toggled.

Th

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值