시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 512 MB41282573.529%

문제

Christmas comes sooner every year. In fact, in one oft-forgotten corner of the world, gift-giving has already started in the form of a Secret Santa syndicate.

Everybody in the small town of Haircombe is going to put their name into a hat. This hat will be given a hearty shuffle, and then afterwards everybody will take turns once more in taking a name back from the hat.

The name each person receives is the name of the fellow citizen to whom they will send a gift.

Of course, one concern with this strategy is that some unfortunate citizens could wind up giving gifts to themselves. What are the chances that this will happen to any of the citizens of Haircombe?

입력

  • One line containing the number N (1 ≤ N ≤ 1012), the number of citizens who will take part in Secret Santa.

출력

  • One line containing one real number; the probability that one or more people wind up giving gifts to themselves.

All output must be accurate to an absolute or relative error of at most 10−6.

예제 입력 1

2

예제 출력 1

0.50000000

예제 입력 2

3

예제 출력 2

0.66666667

예제 입력 3

6

예제 출력 3

0.63194444

출처

ICPC > Regionals > Europe > Northwestern European Regional Contest > The UK & Ireland Programming Contest > UKIEPC 2016 L번

  • 문제를 만든 사람: James Stanley