Logo
(追記) (追記ここまで)

9317번 - Monitor DPI 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 128 MB71150646273.217%

문제

Monitor resolution is increasing fairly quickly and as a responsible consumer you want to be able to compare the Dots Per Inch (DPI) of the screens you are considering purchasing. Unfortunately for you the manufacturers don’t specify the DPI, they only specify the diagonal size in inches and the resolution in width by height. You may assume the width to height ratio is 16:9 for all screens.

Let:

\[W = \text{ the width of the screen in inches} \\ H = \text{ the height of the screen in inches} \\ D = \text{ Diagonal size of screen in inches}\]

Since:

\[D = \sqrt{W^2+H^2}\]

And:

\[H = \frac{9}{16}W\]

Thus

\[D = \sqrt{W^2 + \left(\frac{9}{16}W\right)^2} = \sqrt{\left(1+\frac{9^2}{16^2}\right)W^2} = \sqrt{1+\frac{9^2}{16^2}}W \]\[ W = \frac{16 \times D}{\sqrt{337}} \]\[ \text{DPI}_{\text{Horizontal}} = \frac{\text{Resolution}_{\text{Horizontal}}}{W} \]\[ \text{DPI}_{\text{Vertical}} = \frac{\text{Resolution}_{\text{Vertical}}}{H} \]

입력

Each input line will have 3 numbers, the decimal value D, the integer value \(\text{Resolution}_{\text{Horizontal}}\), and the integer value \(\text{Resolution}_{\text{Vertical}}\). An input line of three zeroes will signify end of input

출력

For each test case (line of input) you should calculate the horizontal and vertical DPI and output it rounded to 2 decimal places as follows:

Horizontal DPI: XXX.XX
Vertical DPI: XXX.XX

제한

예제 입력 1

15.6 1920 1080
11.0 1024 768
0 0 0

예제 출력 1

Horizontal DPI: 141.21
Vertical DPI: 141.21
Horizontal DPI: 106.81
Vertical DPI: 142.41

힌트

출처

School > University of Virginia High School Programming Contest > UVa HSPC 2011 연습 세션 PB번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /