Task
Larry the lazy lizard is taking a very hard Physics class in school. In this class, there is no homework, only tests! He also, being very lazy, wants to study as little as possible for his tests.
He has tests to take in this class. For each tests, you are given two values: and . is the score he would receive if he studies, and is the score he would receive if he chooses not to study. Note that he can either study or not study, there is no in between.
His teacher has also has one conditional: he will only add up the scores of some tests to get their final score! The teacher will randomly remove one test from the total score, but will tell Larry before all the tests are taken.
Note that the total score is calculated by sum of all his tests (unlike traditional schooling, their total score can get very high, not just out of ).
Given these conditions, please output the minimum amount of tests that Larry should study for to ensure that he gets a score of at least , no matter what happens ( is the cutoff for an A
in his class), or output if it is not possible no matter how much he studies. You must output the answer for each of the potential tests that the teacher removes (i.e output integers, where the integer represents the minimum number of tests to study for given that the teacher removes the test).
Input data
The first line contains two space separated integers, and . The next lines contain three integers, with the line containing the space separated integers and , representing the scores after and before studying for that respective test.
Output data
Output lines, with the line containing the minimum amount of tests to study for given that the teacher will remove the test score, to get a total score of at least , or if it's not possible.
Constraints and clarifications
- ;
- ;
- ;
# | Score | Constraints |
---|---|---|
0 | 0 | Example |
1 | 40 | |
2 | 60 | No additional constraints |
Example
stdin
3 5
5 0
3 2
2 1
stdout
2
1
1