Every time you go to a football game, you cannot stop to notice that huge crowds do the same and long lines form to enter the stadium. The stewards have to investigate everyone, searching for forbidden objects, and then the fans have to show their tickets to the digital readers, to confirm that they really have a valid ticket and are allowed to enter. All this process causes delays and football fans have to come early to the stadium to see the game.
The presidents of football clubs all want to give their club's associates the best experience, and they want to minimize the time people spend in the lines to enter the stadium. They can for example increase the number of doors and stewards to augment the flow of people entering. But of course this costs money, and they always want to save on this important aspect. But what is the right balance? Can you help to discover the right balance of costs, by finding the minimum number of stewards and ticket readers to provide a determined quality of service in the entrance of the stadium?
You will consider a simplified version of the entrance on a stadium. Suppose you will only consider a specific sector of the stadium, which has K doors. Each one of these doors has a single steward, ticket reader and a separate line of persons forming. For simplicity the lines can be numbered from 1 to K. Each time a fan arrives, he chooses the line with the minimum amount of persons waiting to enter (in case of a tie, he chooses the line wth the smallest number). When someone is on the front of the line, it is searched by a steward and shows the ticket for a determined number of seconds, which is constant for every line. After that, the person can enter the stadium. The time a fan waits on the line is the time it takes from the arrival to one of the lines until it can enter the stadium after showing the ticket.
For example, imagine you have 3 doors and that the time it takes to search and show the ticket is 10s. Consider that 6 fans arrive at 3, 6, 7, 11, 17 and seconds after the initial opening of the doors. The first fan goes to line 1 and immediately is searched and shows the ticket. With the first fan still waiting, the second fan arrives, and seeing one person on line 1 (still with the steward), it opts for line 2, with zero fans waiting (using the rule described before). Then comes fan nr.3 at 7 seconds, and opts for line 3. After that comes fan nr 4, which goes to line 1, followed by fan nr 5, which goes to line 2. Then, at 13s, the first fan enters the stadium, and fan nr 4 goes to the steward of line 1. At 16s, fan nr 2 enters the stadium and fan nr 5 goes to the front of that line. At 17s, fan nr 3 enters the stadium, leaving line 3 empty, At the same time, fan nr 6 arrives, and seeing line 3 empty (the others have one fan) it goes to line 3. Then fan nr 4 enters the stadium at 23s, fan nr 5 enters at 26 and fan nr 6 enters at 27. The fan which waits more time is fan nr 5, since he waits 14s since his arrival to his entrance.
With this scheme, could you help the presidents discover the minimum amount of doors you need to ensure that the fan that waits more, does not wait more than a determined amount of time?
You will be given the time it takes to search and show a ticket, and also the arrival times of several fans. Your task is to calculate the minimum number of doors needed to ensure that the maximum amount of time a fan waits to enter the stadium is not bigger than a specific limit.
The first line of input contains two space-separated integers T and L, where T indicates the time it takes a fan to be searched by a steward (and then show the ticket to the reader), and L indicates the maximum amount of time you want a fan to wait (1 ≤ T ≤ 1000, 1 ≤ L ≤ 500000 and T ≤ L).
The second line of input contains a single integer F, indicating the number of fans to consider (1 ≤ F ≤ 150). Then follow exactly F lines, each one with a single integer Fi, indicating the arrival time of fan number i (1 ≤ Fi < 2^31). You can be assured that these times will come in increasing order, and that no two fans arrive at the same time.
The output should contain a single line in the format "K M", where K indicates the minimum number of doors needed to ensure that the maximum time a fan waits is smaller or equal than L, and M is the maximum time that a fan waits in that case (with K doors).
10 20 6 3 6 7 11 12 17