Mini Market
Time limit1sMemory limit512 MB
- Level
Not classified yet
- Solved
- No attempts yet
Problem
There are two large mini market companies in Indonesia, Amart (ACMmart) and Imart (ICPCmart). There are points in Indonesia aligned from left to right. The leftmost point is numbered 1 and the rightmost point is numbered . Each point has exactly one person. The distance from point to point is . There are exactly Amarts and Imarts in Indonesia. Every person goes to his or her nearest mini market. If the nearest Amart and the nearest Imart are the same distance away, the person goes to an Imart. The number of Amart visitors is the total number of people who go to any Amart that day. Likewise, the number of Imart visitors is the total number of people who go to any Imart that day. The -th Amart is located at point . You want to place the Imarts so that the number of Imart visitors is maximized. More than one mini market may be placed at the same point.
Input
The first line contains three integers , , and (, ), the number of points, the number of Amarts, and the number of Imarts. The next line contains integers (), the positions of the Amarts.
Output
Print the maximum number of Imart visitors on a single line.