시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
2 초 | 512 MB | 35 | 28 | 25 | 83.333% |
Cesar and Raul like betting and good food, in no particular order. They want to try out a new fancy restaurant and they decided to make a bet - they are going to play a game the loser pays for dinner.
They have a box with N balls. Each ball contains a distinct number between 1 and N. Then, the game proceeds with these steps:
They are quite eager to try out this new restaurant and they're now wondering: how many rounds will the game last?
Given the number N of balls, the number aD of balls they sraw from the box in each round, the amount C of numbers in theis cards and the numbers they wrote down, find the expected number of rounds the game will last.
The first line of the input consists of three space separated integers: N, D, and C. N is the number of balls, D is the number of balls drawn in each round, and C is the cards' size. Each of the following two lines contains C space separated integers: the number Cesar and Raul wrote down, respectively.
The output is the expected number of rounds of the game.
The result will be considered correct as long as the absolute error does not exceed 10-3.
2 1 1 1 2
1.00000
30 5 10 2 3 5 7 11 13 17 19 23 29 20 18 16 14 12 10 8 6 4 2
13.30378
ICPC > Regionals > Europe > Southwestern European Regional Contest > SWERC 2016 D번