Codeforces Round 219 (Div. 1)
A
Counting Kangaroos is Fun
Codeforces
1600
原题
←B →
翻译中…

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.

翻译中…

Input

翻译中…

The first line contains a single integer — $*n*$ $(1 ≤ *n* ≤ 5·10^{5})$. Each of the next $*n*$ lines contains an integer $*s*_{*i*}$ — the size of the $*i*$-th kangaroo $(1 ≤ *s*_{*i*} ≤ 10^{5})$.

翻译中…

Output

翻译中…

Output a single integer — the optimal number of visible kangaroos.

翻译中…

样例

Input #1
8
2
5
7
6
9
8
4
2
Output #1
5
InputCopy OutputCopy
Input #2
8
9
1
6
2
6
5
8
3
Output #2
5
InputCopy OutputCopy
题目信息
题号
372A
时间限制
1 s
内存限制
256 MB
标签
二分
贪心
排序
双指针

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。