Gena is the genius of sports programming. He can solve any problem, so he has never lost a contest. Today Gena decided to write the contest badly on purpose, because he was tired to take always the first place.
But Gena cannot simply not submit the problems at the contest, as this can be called unsportsmanlike behavior. Therefore, he decided to choose an unsuccessful problem solving strategy, namely, he wants to hand over problems in such a way as to score as few points as possible.
The contest consists of problems, numbered from to . For solving the problem , the participant receives p_i points. Gena reads all problems and immediately comes up with a solution for each. Also, for each task, he estimated the time it would take him to write a solution for this task: task requires t_i minutes for Gena to solve. It remains to choose the order in which he will write solutions. Looking at his watch, Gena realized that minutes left until the end of the contest.
Gena plans to act as follows. He selects one of the previously unsolved problems and writes down its solution in the appropriate time. Gena never chooses a problem that he cannot write until the end of the contest. After writing the solution, he immediately sends the problem for verification and receives p_i points for it. Time is not wasted on sending and checking the solution. After that, he moves on to another task. As soon as Gena realizes that he will not have time to write any of the remaining problems until the end of the contest, he stops writing solutions.
Now Gena wants to choose the order of writing problems that will minimize his total score for the contest. Help Gena to determine the minimum possible total score he can get by following the procedure described.
The first line contains two integers and (1 \leq n, t \leq 2000) - number of problems and time until the end of the contest in minutes.
The following lines describe the tasks, - th line contains two numbers t_i, p_i (1 \leq t_i \leq 2000, 1 \leq p_i \leq 10^6) - the time it takes for Gena to write a solution for this problem, and the number of points the participant gets for solving this problem.
Print one number - the minimum number of points that Gena can get in the contest.
Ejemplo 1
Ejemplo 2