Problem1567--CF825 - C. Multi-judge Solving

1567: CF825 - C. Multi-judge Solving

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 256 MiB

Description

Makes solves problems on Decoforces and lots of other different online judges. Each problem is denoted by its difficulty − a positive integer number. Difficulties are measured the same across all the judges (the problem with difficultydon Decoforces is as hard as the problem with difficultydon any other judge).
Makes has chosen $n$ problems to solve on Decoforces with difficulties $a_1,a_2,...,a_n$. He can solve these problems in arbitrary order. Though he can solve problemiwith difficulty $a_i$ only if he had already solved some problem with difficulty $d\ge \frac{a_1}{2}$ (no matter on what online judge was it).
Before starting this chosen list of problems, Makes has already solved problems with maximum difficulty $k$.
With given conditions it's easy to see that Makes sometimes can't solve all the chosen problems, no matter what order he chooses. So he wants to solve some problems on other judges to finish solving problems from his list.
For every positive integer $y$ there exist some problem with difficulty $y$ on at least one judge besides Decoforces.
Makes can solve problems on any judge at any time, it isn't necessary to do problems from the chosen list one right after another.
Makes doesn't have too much free time, so he asked you to calculate the minimum number of problems he should solve on other judges in order to solve all the chosen problems from Decoforces.

Input

The first line contains two integer numbers $n,k\ (1≤n≤10^3,\ 1≤k≤10^9)$.

The second line contains $n$ space-separated integer numbers $a_1,a_2,...,a_n\ (1≤a_i≤10^9)$.

Output

Print minimum number of problems Makes should solve on other judges in order to solve all chosen problems on Decoforces.

Sample 1 Input

3 3 
2 1 9

Sample 1 Output

1
Makes at first solves problems 1 and 2. Then in order to solve the problem with difficulty 9, he should solve problem with difficulty no less than 5. The only available are difficulties 5 and 6 on some other judge. Solving any of these will give Makes opportunity to solve problem 3.

Sample 2 Input

4 20
10 3 6 3

Sample 2 Output

0
he can solve every problem right from the start.

HINT

CF825C.

Source/Category