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

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

Lucky Shirt

시간 제한2초메모리 제한1024 MB

요약
셔츠 n장이 쌓여 있고 행운의 셔츠가 i번째에 있을 때, k번의 무작위 세탁 주기 후 그 셔츠의 기대 위치를 구한다.
난이도

보통10점 중 7점

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

문제

You, a frantic competitive programmer, have collected a large number of T-shirts by competing in various programming contests. In fact, you have so many, that these are the only T-shirts you wear anymore. You keep them neatly folded in a large stack in your oversized closet. Each morning, you pick the top shirt from your stack of shirts to wear that day. At the end of the day, you throw the shirt in the laundry basket.

In order to keep a fresh supply of clean shirts, you sometimes also do laundry at night, washing all shirts in the laundry basket (including the one you wore that day). This is not according to some neat schedule however; the number of days between your wash cycles is a uniformly random integer between 11 (in which case you would wash only a single shirt) and the number of shirts you have. After washing your clothes, you put them back on top of the stack in a uniformly random order.

It is now the night after a successful programming contest, and you decide that the T-shirt you got there is your lucky shirt from now on. You wonder when you will be able to wear it again, and entertain yourself with thoughts about the good fortune you will receive when you do. You just completed your laundry and put all your shirts on the stack. Knowing the current position of your lucky shirt in the stack, what is the expected position of your lucky shirt after kk more washing cycles?

입력

The input consists of:

  • One line containing three integers nn (1≤n≤1061\leq n\leq 10^6), the number of shirts you have, ii (1≤i≤n1\leq i\leq n), the position of your lucky shirt counted from the top, and kk (1≤k≤1061\leq k\leq 10^6), the number of washing cycles.

출력

Output the expected position of your lucky shirt after kk washing cycles. Your answer should have an absolute or relative error of at most 10−610^{-6}.

예제3

  1. 예제 1

    입력
    3 2 2
    
    예상 출력
    1.833333333
    
  2. 예제 2

    입력
    5 1 1
    
    예상 출력
    2.0
    
  3. 예제 3

    입력
    10 7 100
    
    예상 출력
    5.499986719