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

17574번 - Jackpot 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 (추가 시간 없음) 512 MB116524043.011%

문제

The thunderingly fun new game show of ’Jackpot’ has bounded onto televisio screens up and down the land and is the next big thing. It runs along a simple premise: there are a number of doors, behind one of which is hidden a monetary prize and behind all of the others of which are hidden goats. Each contestant chooses how many doors will be opened before they pick a door to look at. The prize decreases as each door is opened. If they manage to open the door and find the money they get to keep it!

Not content with guessing, you’ve decided to try and work out the best number of doors to open to maximise your expected profit, where expected profit is the probability of winning multiplied by the remaining prize fund.

You’ve managed to find out that the remaining prize fund PR is a function of the initial prize fund m, the number of doors opened d and a scaling factor f, ie.

PR = m − (d · f)2

Given the number of doors, initial prize fund and the scaling factor can you work out how many doors should be opened before you try to pick a door to maximise your expected profit?

입력

One line of input containing:

  • One integer n (1 ≤ n ≤ 1018), the number of doors.
  • One integer m (1 ≤ m ≤ 1018) the initial prize fund.
  • One floating point f (0 < f ≤ 1), the scaling factor.

There will always only be one door with the best value.

출력

One line containing

  • One floating point number, the value of the expected payout.

The output must be accurate to an absolute or relative error of at most 10−6.

제한

예제 입력 1

4 100 1

예제 출력 1

91.0

예제 입력 2

20000 100200300 0.8

예제 출력 2

5628.83998462

힌트

출처

ICPC > Regionals > Europe > Northwestern European Regional Contest > The UK & Ireland Programming Contest > UKIEPC 2018 J번

  • 문제를 만든 사람: Jim Grimmett
  • 빠진 조건을 찾은 사람: lobo_prix
(追記) (追記ここまで)

출처

대학교 대회

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

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