Two Pirates - 2
시간 제한2초메모리 제한512 MB
첫 번째 해적은 최적으로 고르고 두 번째 해적은 남은 보물 중 하나를 무작위로 고를 때, 두 해적이 가져가는 보물 가치 합의 기댓값을 구한다.
문제
Two pirates are dividing looted treasures. There are treasures, the -th of which costs gold. They move in rotation, each turn a pirate picks one of the remaining treasures. The thing is, the second pirate is drunk, so he doesn't make optimal picks and each turn just picks a random available treasure, uniformly. The first pirate knows that and always makes the optimal picks.
Find the expected costs of treasures picked by both pirates.
입력
Two pirates are dividing looted treasures. There are treasures, the -th of which costs gold. They move in rotation, each turn a pirate picks one of the remaining treasures. The thing is, the second pirate is drunk, so he doesn't make optimal picks and each turn just picks a random available treasure, uniformly. The first pirate knows that and always makes the optimal picks.
Find the expected costs of treasures picked by both pirates.
출력
Output two floating point numbers: the expected costs of treasures picked by the first and the second pirates.
Absolute or relative error of the numbers shouldn't exceed .