아직 만들고 있는 페이지입니다.

이 페이지는 아직 만드는 중입니다. 보이는 내용은 바뀔 수 있습니다.

Lightbulbs

시간 제한1초메모리 제한256 MB

요약
N개의 행에 M개의 전구가 있고 각 전구는 확률 P로 켜진다. 한 행에서 연속으로 켜진 전구 수의 최댓값의 기댓값을 구한다.
난이도

보통10점 중 7점

유형
동적 계획법, 확률, 조합론, 수학
정답자
아직 제출이 없습니다

문제

Thomas Edison is actively working on a better version of a lightbulb. During that process, he covers entire fields with batches of lightbulbs and conducts tests on them. In his current experiment, he arranged NN rows with MM lightbulbs in each row. Each lightbulb has a chance PP of working, otherwise, it’s faulty and won’t light up. Thomas wants to find the expected value of the length of the longest horizontal sequence of lightbulbs that are working.

For example, in the setup below, where 11 is a working lightbulb and 00 is faulty, the length of the longest horizontal sequence of lightbulbs that are working is 33, since there are three consecutive ones in the second row (and also in the fourth row).

1 0 1 1
0 1 1 1
0 1 0 0
1 1 1 0
1 1 0 1

Note that we’re interested in horizontal sequences only.

입력

You’re given three numbers separated by spaces – positive integers NN and MM, and a real number PP.

출력

Output the answer to the problem. Your answer would be considered correct if its absolute or relative error is less than 10−410^{-4}.

제한

  • 1≤N,M≤20001 ≤ N, M ≤ 2000
  • 0≤P≤10 ≤ P ≤ 1

예제2

  1. 예제 1

    입력
    2 3 0.5
    
    예상 출력
    1.828125000000
    
  2. 예제 2

    입력
    47 74 1
    
    예상 출력
    74.000000000000