포럼
문제 ICPC00194

I. Inflation

스페셜 저지 — 출력을 사용자 정의 프로그램으로 검사하므로 여러 정답이 인정될 수 있습니다.
설명

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 \(1\) up to \(n\). A balloon of size \(s\) has a capacity of \(s\) decilitres.

To avoid inflating the balloons by hand, the organisers also bought \(n\) helium gas canisters. Each canister can only be used to inflate one balloon, and must be emptied completely into that balloon (it is not possible to disconnect a canister from a balloon before the canister has been fully used).

Unfortunately the gas canisters were bought at a garage sale, and may contain differing amounts of helium. Some may even be empty! To make the best of this challenging situation, the canisters will have to be paired with the balloons smartly.

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. What is the maximum such (minimum) fraction that is possible?

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

제약
입력 형식

The input consists of:
- One line with the integer \(n\) (\(1 \le n \le 2\cdot10^5\)), the number of balloons and gas canisters.
- One line with \(n\) integers \(c_1, \ldots, c_n\) (\(0 \le c_i \le n\) for each \(i\)), the amounts of helium in the gas canisters, in decilitres.

출력 형식

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

Your answer should have an absolute or relative error of at most \(10^{-6}\).

예제 1
입력
6
6 1 3 2 2 3
출력
0.6
예제 2
입력
2
2 2
출력
impossible
예제 3
입력
5
4 0 2 1 2
출력
0
문제 정보

생성자가 기록되지 않았습니다.

출처 ICPC NWERC 2018

평가 및 의견

I. Inflation

개요
출제자 난이도 Unrated 레이팅 미적용 의견 0 / 1 공개 집계 (커뮤니티 난이도, 주요 주제, 품질)는 의견이 충분히 모이면 공개됩니다.

Log in to rate problems.

개별 의견

아직 의견이 없습니다. 자격이 된다면 위 양식에서 가장 먼저 평가해 보세요.

풀이 제출

I. Inflation

게스트로 둘러보고 있습니다. 로그인하면 풀이를 제출하고 진행 상황을 확인할 수 있습니다. 로그인하고 제출하기
공개
C++20 Tab 들여쓰기 · Ctrl+/ 주석 토글 · Enter 자동 들여쓰기
1 1 1 0 공백: 4 · UTF-8