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

21257번 - Fireworks 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 512 MB75321631.373%

문제

Kotori is practicing making fireworks for the upcoming hanabi taikai(Hanabi taikai: Romaji of the Japanese word, which means the firework... err... party?). It takes her $n$ minutes to make a single firework, and as she is not really proficient in making fireworks, each firework only has a probability of $p \times 10^{-4}$ to be perfect.

After she finishes making a firework, she can just start making the next firework, or take $m$ minutes to light all the remaining fireworks finished before. If there is at least one perfect firework among the lit ones, she will be happy and go to rest. Otherwise, she will continue practicing. Can you tell her the minimum expected practicing time before she goes to rest if she takes the optimal strategy?

Notice that no matter how many fireworks remain, it always takes $m$ minutes to light them all.

입력

There are multiple test cases. The first line of the input contains an integer $T$ (1ドル \le T \le 10^4$) indicating the number of test cases. For each test case:

The first and only line contains three integers $n,ドル $m$ and $p$ (1ドル \le n, m \le 10^9,ドル 1ドル \le p \le 10^4$).

출력

For each test case, output one line containing one number indicating the minimum expected practicing time.

Your answer will be considered correct if and only if the absolute or relative error does not exceed 10ドル^{-4}$.

제한

예제 입력 1

3
1 1 5000
1 1 1
1 2 10000

예제 출력 1

4.0000000000
10141.5852891136
3.0000000000

힌트

출처

Contest > Open Cup > 2020/2021 Season > Stage 9: Grand Prix of Nanjing, Division 1 F번

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

출처

대학교 대회

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

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