RiseOJ는 solved.ac와 제휴 관계가 없습니다. 티어 아이콘 © solved.ac. solved.ac
포럼
문제 ICPC00087

C. Contest Struggles

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

Lotte is competing in a programming contest. Her team has already solved \(k\) out of the \(n\) problems in the problem set, but as the problems become harder, she begins to lose focus and her mind starts to wander.

She recalls hearing the judges talk about the difficulty of the problems, which they rate on an integer scale from \(0\) to \(100\), inclusive. In fact, one of the judges said that "the problem set has never been so tough, the average difficulty of the problems in the problem set is \(d\)!"

She starts thinking about the problems her team has solved so far, and comes up with an estimate \(s\) for their average difficulty. In hope of gaining some motivation, Lotte wonders if she can use this information to determine the average difficulty of the remaining problems.

제약
입력 형식

The input consists of:
- One line with two integers \(n\) and \(k\) (\(2\leq n\leq 10^6\), \(0 < k < n\)), the total number of problems and the number of problems Lotte's team has solved so far.
- One line with two integers \(d\) and \(s\) (\(0\leq d,s \leq 100\)), the average difficulty of all the problems and Lotte's estimate of the average difficulty of the problems her team has solved.

출력 형식

Assuming Lotte's estimate is correct, output the average difficulty of the unsolved problems, or "impossible" if the average difficulty does not exist. Your answer should have an absolute or relative error of at most \(10^{-6}\).

예제 1
입력
2 1
70 50
출력
90.00
예제 2
입력
10 3
80 90
출력
75.7142857
예제 3
입력
2 1
100 10
출력
impossible
문제 정보

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

출처 ICPC NWERC 2020

평가 및 의견

C. Contest Struggles

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

Log in to rate problems.

개별 의견

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

풀이 제출

C. Contest Struggles

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