Chang and the Mathematical Brainbuster

3.6

5 votes
Problem

Chang loves solving mathematical puzzles. One day he was solving a puzzle. According to the problem statement of the puzzle: "there are N integers. you are asked to delete some numbers such that the series obtained after deletion follows the condition. (condition/equation): a - 3b<=0 where a is the maximum and b is the minimum of the series obtained after deletion is done. This condition/equation must be followed by the series of numbers obtained by deleting some numbers from original series of numbers". The question asks to tell the mininium number of integers to be deleted so that the above condition is followed by the remaining numbers obtained after deletion. Help chang in solving this mathematical brainbuster.

INPUT

The first line contain number of integers "N".The second line contains those N integers.

OUTPUT

output a single integer ie.the minimum number of integers needed to be removed to follow the condition.

Constraint

1 <= N <= 10^4
1 <= input number <= 10^4

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

here if we remove 4 from the series.Then we will be left with 1 and 2 which satisfies the condition a-3b<=0 so the answer will be 1.

Editor Image

?