View problem - Taxis (POI13_tak)

Time limitMemory limit# of submissions# of submitted usersSolved #Accepted user ratio
1000 ms64 MiB93201785.00%

Byteasar wants to take a taxi from the town Bytehole to the town Bytepit, which is mm kilometres away from Bytehole. Exactly dd kilometres along the way from Bytehole to Bytepit, there is a base of nn taxis, numbered from 11 to nn. The taxi no. ii has enough fuel to drive exactly xix_i kilometres.

Byteasar can change taxis at any point. All the taxis start at their base but need not return there. Your task is to determine whether Byteasar can be driven from Bytehole to Bytepit, and if so, what it the minimum number of taxis required for such a journey.

Input

The first line of the standard input holds three integers, mm, dd, and nn (1dm10181 \le d \le m \le 10^{18}, 1n500,0001 \le n \le 500,000), separated by single spaces. Those denote, respectively: the distance from Bytehole to Bytepit, the distance from Bytehole to the taxi base, and the number of taxis at the base. The second line of input contains nn integers, x1,x2,,xnx_{1}, x_{2}, \cdots, x_{n} (1xi10181 \le x_{i} \le 10^{18}), separated by single spaces. The number xix_{i} denotes the maximum distance (in kilometres) that the ii-th taxi can travel.

In tests worth 40% of all points an additional condition n5,000n \le 5,000 holds.

Output

Your program should print a single integer to the standard output: the minimum number of taxis Byteasar has to take to get from Bytehole to Bytepit. If getting there is impossible, your program should print the number 00.

Example

For the input data:

42 23 6
20 25 14 27 30 7

the correct result is:

4