Problem Statement
You are going out for a walk, when you suddenly encounter a monster. Fortunately, you have N katana (swords), Katana 1, Katana 2, …, Katana N, and can perform the following two kinds of attacks in any order:
Wield one of the katana you have. When you wield Katana i (1≤i≤N), the monster receives ai points of damage. The same katana can be wielded any number of times.
Throw one of the katana you have. When you throw Katana i (1≤i≤N) at the monster, it receives bi points of damage, and you lose the katana. That is, you can no longer wield or throw that katana.
The monster will vanish when the total damage it has received is H points or more. At least how many attacks do you need in order to vanish it in total?
Constraints
1≤N≤105
1≤H≤109
1≤ai≤bi≤109
All input values are integers.
Input
Input is given from Standard Input in the following format:
You are going out for a walk, when you suddenly encounter a monster. Fortunately, you have N katana (swords), Katana 1, Katana 2, …, Katana N, and can perform the following two kinds of attacks in any order:
Wield one of the katana you have. When you wield Katana i (1≤i≤N), the monster receives ai points of damage. The same katana can be wielded any number of times.
Throw one of the katana you have. When you throw Katana i (1≤i≤N) at the monster, it receives bi points of damage, and you lose the katana. That is, you can no longer wield or throw that katana.
The monster will vanish when the total damage it has received is H points or more. At least how many attacks do you need in order to vanish it in total?
Constraints
1≤N≤105
1≤H≤109
1≤ai≤bi≤109
All input values are integers.
Input
Input is given from Standard Input in the following format: