포럼
문제 ICPC00205

B. Bottle Flip

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

It marks the year 2022 where the bottle flip challenge finally reached the last people on earth; the NWERC Jury. As you may know, the objective of the challenge is to flip a bottle of water \(360^{\circ}\) through the air and hope that it lands standing upright. Figure demonstrates a successful bottle flip.

After many failed attempts, we noticed that this task gets significantly easier if the bottle is filled with just the right amount of water. The simple reason for this is that the amount of water affects the centre of mass of our bottle as it is about to land. For the sake of completeness, we define the centre of mass as the unique point at which the whole mass of the bottle could be concentrated without changing the bottle's reaction to gravity, regardless of the orientation of the bottle. Note that we implicitly assume that the water will stay at the bottom of the bottle. This defines exactly what you would intuitively think of as centre of mass.

A lower centre of mass makes it easier for the bottle to stay upright after it lands. Unfortunately, the optimal amount of water depends on the bottle, and we already wasted enough time on this challenge...

Given that our bottle is a perfect cylinder of height \(h\) and radius \(r\), determine the optimal amount of water the bottle should contain so that our chances of landing a successful bottle flip are maximised. You can assume that both the water and the air contained in the bottle have uniform density, and that the weight of the bottle itself is negligible.

제약
입력 형식

The input consists of:
- One line with four integers \(h\), \(r\), \(d_a\), and \(d_w\) (\(1 \leq h, r, d_a, d_w \leq 1000\), \(d_a < d_w\)), where \(h\) and \(r\) are the height and radius of the bottle, and \(d_a\) and \(d_w\) are the densities of air and water, respectively.

출력 형식

Output the height such that filling the bottle with water up to this height results in the lowest possible centre of mass while the bottle is standing upright. Your answer should have an absolute or relative error of at most \(10^{-6}\).

예제 1
입력
22 4 1 4
출력
7.3333333333
예제 2
입력
7 2 655 988
출력
3.1415941720
문제 정보

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

출처 ICPC NWERC 2022

평가 및 의견

B. Bottle Flip

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

Log in to rate problems.

개별 의견

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

풀이 제출

B. Bottle Flip

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