#P16992. [NWERC 2018] Inflation

[NWERC 2018] Inflation

Problem Description

For NWERC 2018, the organisers have done something rather special with the balloons. Instead of buying balloons of equal size, they bought one balloon of every integer size from 11 up to nn. A balloon of size ss has a capacity of ss decilitres.

To avoid inflating the balloons by hand, the organisers also bought nn helium gas canisters. Each canister can only be used to inflate one balloon, and must be emptied completely into that balloon.

Unfortunately the gas canisters were bought at a garage sale, and may contain differing amounts of helium. Some may even be empty! The organisers want to assign all of the gas canisters to separate balloons, such that the balloon that is inflated the least, relative to its capacity, still contains the maximum possible fraction of helium inside.

Balloons filled beyond their capacity will explode. Explosions are upsetting and must be avoided.

Input Format

The input consists of:

  • One line with the integer nn (1n21051\le n\le 2\cdot10^5), the number of balloons and gas canisters.
  • One line with nn integers c1,,cnc_1,\ldots,c_n (0cin0\le c_i\le n), the amounts of helium in the gas canisters, in decilitres.

Output Format

If it is possible to fill all the balloons without any exploding, output the maximum fraction ff such that every balloon can be filled to at least ff of its capacity. Otherwise, output impossible.

Your answer should have an absolute or relative error of at most 10610^{-6}.

6
6 1 3 2 2 3
0.6
2
2 2
impossible
5
4 0 2 1 2
0