RiseOJ는 solved.ac와 제휴 관계가 없습니다. 티어 아이콘 © solved.ac. solved.ac
포럼
문제 ICPC00094

L. Lucky Shirt

스페셜 저지 — 출력을 사용자 정의 프로그램으로 검사하므로 여러 정답이 인정될 수 있습니다.
설명

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 \(1\) (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 \(k\) more washing cycles?

제약
입력 형식

The input consists of:
- One line containing three integers \(n\) (\(1\leq n\leq 10^6\)), the number of shirts you have, \(i\) (\(1\leq i\leq n\)), the position of your lucky shirt counted from the top, and \(k\) (\(1\leq k\leq 10^6\)), the number of washing cycles.

출력 형식

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

예제 1
입력
3 2 2
출력
1.833333333
예제 2
입력
5 1 1
출력
2.0
예제 3
입력
10 7 100
출력
5.499986719
문제 정보

생성자가 기록되지 않았습니다.

출처 ICPC NWERC 2021

평가 및 의견

L. Lucky Shirt

개요
출제자 난이도 Unrated 레이팅 미적용 의견 0 / 50 공개 집계 (커뮤니티 난이도, 주요 주제, 품질)는 의견이 충분히 모이면 공개됩니다.

Log in to rate problems.

개별 의견

아직 의견이 없습니다. 자격이 된다면 위 양식에서 가장 먼저 평가해 보세요.

풀이 제출

L. Lucky Shirt

게스트로 둘러보고 있습니다. 로그인하면 풀이를 제출하고 진행 상황을 확인할 수 있습니다. 로그인하고 제출하기
공개
C++20 Tab 들여쓰기 · Ctrl+/ 주석 토글 · Enter 자동 들여쓰기
1 1 1 0 공백: 4 · UTF-8