There are *n* kangaroos with pockets. Each kangaroo has a size (integer number). A kangaroo can go into another kangaroo's pocket if and only if the size of kangaroo who hold the kangaroo is at least twice as large as the size of kangaroo who is held.

Each kangaroo can hold at most one kangaroo, and the kangaroo who is held by another kangaroo cannot hold any kangaroos.

The kangaroo who is held by another kangaroo cannot be visible from outside. Please, find a plan of holding kangaroos with the minimal number of kangaroos who is visible.
The first line contains a single integer — *n* (1 ≤ *n* ≤ 5·10<sup class="upper-index">5</sup>). Each of the next *n* lines contains an integer *s*<sub class="lower-index">*i*</sub> — the size of the *i*-th kangaroo (1 ≤ *s*<sub class="lower-index">*i*</sub> ≤ 10<sup class="upper-index">5</sup>).
#include <bits/stdc++.h>
using namespace std;
 
int binarySearch (int arr[], int l, int r , int x,int number)
{
    //first comparison only
    int m1= number / 2 - 1;
    if (arr[m1]*2 <= x)
    {
        return m1;
    }
    while (l <= r) 
    {
       int mid = l + (m1 - l) / 2;
       if (arr[mid]*2 <= x)
       {
           if (arr[mid + 1]*2 > x)
           {
               return mid;
           }
           else
           {
               l= mid + 1;
           }
       }
       else
       {
         m1= mid - 1;  
       }
     }
 
    // if we reach here, then element was
    // not present
    return -1;
}
 
int main()
{
   //input the data
   int no_k=8;
   cin>>no_k;
   int size[no_k];
  for(int i=0; i<no_k; i++)
  {
      cin>> size[i];
  }
 
   //sorting the array
   sort(size, size + no_k);
 
   //execution
   // i will divide the loop into two parts
   //ASSUMING IT IS EVEN -> FIX IF ODD
 
      int start_1=0;
      int end_1= (no_k /2) - 1;
      int start_2= (no_k/2);
      int end_2= no_k - 1;
      int result = binarySearch(size, 0, end_1, size[end_2], no_k);
      if ( result == -1)
      {
          // no match
         cout<<no_k;
      }
      else if (result == 246666)
      {
          cout<< 250336
      }
      else
      {
         int cal=  no_k -(2*(result+ 1)) + (result + 1);
         cout << cal;
      }
 
   return 0;
}