Daniel's Debugging Disaster

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

요약
요청 실패 확률 K가 주어질 때, R번의 시도 중 적어도 한 번은 N개의 독립 요청이 모두 성공할 확률을 계산한다.
난이도

쉬움10점 중 3점

유형
확률, 수학
정답자
아직 제출이 없습니다

문제

Daniel is a software engineer and is working at a company that makes payment processing software. Because lots of money is being transacted through the software, it must be highly reliable.

In order for the software to function properly, it must successfully make NN requests in a row. Each request opens a new connection via a random port. If any of the requests fail, then the money will be lost! Unfortunately for Daniel, some requests are failing.

As he debugs the program, and realizes that he misconfigured his firewall and blocked KK\\% of the ports on the computer that the software is running on. This means that there is a KK\\% chance that any given request will be blocked by the firewall, and thus fail. Note that because the port used by each request is random, each request is independent, meaning that every request has a KK\\% chance of failing, regardless of the outcome of other requests.

However, instead of fixing the firewall, Daniel decides to just retry the NN requests if one or more of them fails.

He adds a loop to the program that will attempt the NN requests until either all of them succeed, or RR attempts have been made. That is, if on any of the RR attempts, all NN requests succeed, then the program is successful, and no more attempts are made. If the program is successful, then the customer is happy because the program did not lose their money.

Given KK, NN, and RR, can you calculate the probability that the program will succeed?

입력

There will be three lines of input.

The first line contains the real number 0≤K≤10 \leq K \leq 1 representing the probability that a request will be blocked by the firewall. Each number contains at most one digit after the decimal point.

The second line contains the integer 1≤N≤201 \leq N \leq 20 representing the number of requests that must succeed in a row for the program to be considered "successful."

The third line contains the integer 1≤R≤201 \leq R \leq 20 representing the number of times that the program will attempt the NN requests.

출력

Output a real number representing the probability that the program will succeed. (Anything within 0.000010.00001 of the correct probability will be accepted.)

예제2

  1. 예제 1

    입력
    0.5
    5
    10
    
    예상 출력
    0.27202384332787144
    
  2. 예제 2

    입력
    0.6
    5
    10
    
    예상 출력
    0.09780797617643733