Master of "Wormix"
Vasylko is excited about the game "Wormix" and has progressed to a level where he can unlock a boss fight. To do so, he needs to accumulate at least K points from missions. There are a total of N missions available, each with a known duration and point value. Vasylko is a skilled player and can complete any mission with ease.
However, he doesn't have enough time to complete all the missions, but he is eager to unlock the boss fight. Therefore, he wants to determine the minimum amount of time required to earn at least K points.
Input
The first line contains two integers N and K (1 ≤ N ≤ 100 – the number of missions, 0 ≤ K ≤ 10000 – the number of points needed to unlock the boss fight). The following N lines each contain two integers: a[i] – the points awarded for completing the i-th mission, and t[i] – the time required to complete it, with 0 < a[i], t[i] ≤ 100.
Output
Output the minimum time in which Vasylko can earn at least K points, or "-1" if it is not possible.