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

31955번 - Manhattan Walk 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 (추가 시간 없음) 2048 MB (추가 메모리 없음)45414191.111%

문제

It's a grid system! You begin at the top left corner and want to walk to the bottom right corner. Every location is at integer coordinates, and has an arrow pointing down or right and a timer that, every few seconds, flips the arrow from down to right, or from right to down. When you begin your walk, every arrow is pointing down or right with equal probability, and every timer has a real value chosen uniformly in the range from zero to its maximum wait time.

At any moment in time, if you are at a given location, you can:

  • Move down one location if the new location is on the grid and the arrow is pointing down.
  • Move right one location if the new location is on the grid and the arrow is pointing right.
  • Wait for the timer to finish its countdown so that the arrow flips from down to right, or from right to down.

When you arrive at a new location, you are able to see the timer and can therefore take that into account when deciding which action to take. However, you are not able to look ahead---you can only see the timer and arrow for the exact grid point you occupy. You hate waiting, and want to minimize the total amount of time you're waiting for an arrow to flip.

What is the expected amount of time you have to wait if you make decisions optimally?

입력

The single line of input contains three integers $r,ドル $c$ (1ドル \leq r, c \leq 10^3$), and $p$ (1ドル \leq p \leq 10^9$), where $r$ is the number of rows in the grid, $c$ is the number of columns in the grid, and $p$ is the maximum value a timer can show.

출력

Output a single number, which is the expected time you have to wait if you make optimal decisions. Your answer will be accepted if the absolute or relative error is within 10ドル^{-6}$ of the judge's answer.

제한

예제 입력 1

2 3 8

예제 출력 1

2.875

예제 입력 2

5 5 5

예제 출력 2

2.43223387

힌트

출처

ICPC > Regionals > North America > North America Championship > North America Championship 2024 G번

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

출처

대학교 대회

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

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