Sweet Selection

4

1 votes
Medium
Problem

Given N sweets, each has a unique sweetness level. Sweets are sorted in incresing order according to the sweetness. Now you select a subset of sweets to eat. The only condition to satisfy while selecting the sweets is that, for every selected candy(except the last one) the sweetness of next candy should not be more then twice the sweetness of current candy.

For example, if you selected k candies with sweetness A1,A2,A3,...,Akthen for each j from 1 to k-1, Aj+1 <= 2Aj should hold.

You want to eat maximum number of candies. Tell maximum number of candies that you can eat.

 

INPUT

First line of input contains N, number  of candies.
Next line contains N integers A1,A2,A3,...,An, sweetness of candies.

 

OUTPUT

Output a single integer denoting maximum number of candies you can eat.

 

CONSTRAINTS

1<=N<=105
1<=Ai<=109

 

SAMPLE TEST CASE 1

4
3 7 15 34

SAMPLE OUTPUT 1

1

Time Limit: 1
Memory Limit: 256
Source Limit:
Explanation

In First test case we can select the subset [5,9,15], so answer is 3.

Editor Image

?