PivotOJ

Train Boarding

시간 제한: 1000ms메모리 제한: 1024MB출처: ICPC Rocky Mountain Regional 2020BOJ 21207

문제

Punctual City is well known for the punctuality of its citizens and its public transportation system.  It is particularly famous for its train system.  It is always on time, and never too late (or even too early).  Statistics about train boarding is regularly collected to keep things running smoothly.

A train has cars numbered 11 to NN (from front to back), each of length LL meters. Each car has exactly one door for boarding located at the center (L/2L/2 meters from each end of the car). There are no gaps between cars.

When the train stops at the boarding platform, each passenger waiting for the train walks to the door of the car which is closest to them, taking the higher numbered car in the case of a tie.

Given the location of the passengers relative to the train, help the city by reporting the longest distance that any passenger has to walk and the maximum number of passengers boarding any single car.

입력

The first line of input contains three integers NN (1N1001 \leq N \leq 100), which is the number of cars of the train, LL (2L1002 \leq L \leq 100), which is the length of each car, and PP (1P10001 \leq P \leq 1\,000), which is the number of passengers waiting for the train. It is guaranteed that LL is an even number.

The next PP lines describe the location of the passengers relative to the train. Each line contains a single integer xx (0x100000 \leq x \leq 10\,000), which is the distance the passenger is behind the front-end of the train.

출력

Display the longest distance that any passenger has to walk on one line.  On the next line, display the maximum number of passengers boarding any single car.

예제

예제 1

입력
68 90 6
3809
288
2306
2215
4211
379
출력
27
1

예제 2

입력
27 58 10
823
678
799
224
349
1002
308
978
602
265
출력
28
1
코드를 제출하려면 로그인하세요.