#P2390. 地标访问

地标访问

Description

Bessie is traveling along a road with many landmarks and wants to visit as many landmarks as possible before sunset. Bessie can move one unit of distance per minute.

Treat the road as a number line. Bessie starts at the origin. There are n(1n5×104)n(1 \le n \le 5\times 10^4) landmarks on the road, each with a distinct coordinate xi(xi105)x_i(|x_i| \le 10^5). Sunset occurs after t(1t109)t(1 \le t \le 10^9) minutes.

Input Format

The first line: two integers t,nt,n.

The second line to line n+1n+1: the coordinates xix_i.

Output Format

A single integer: the maximum number of landmarks Bessie can visit.

25 14
16
8
-7
3
10
-15
-17
6
-12
14
-13
2
9
-5

8

Hint

  1. Bessie does not need to return to the origin at sunset.
  2. This differs from the original simple simulation problem.
  3. The testdata has been modified compared to the original problem.

Translated by ChatGPT 5