시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 256 MB267550.000%

문제

The people of Absurdistan discovered how to build roads only last year. After the discovery, each city decided to build its own road, connecting the city with some other city. Each newly built road can be used in both directions.

Absurdistan is full of absurd coincidences. It took all N cities precisely one year to build their roads. And even more surprisingly, when the roads were finished it was possible to travel from every city to any other city using the newly built roads. We say that such a road network is connected. Being interested in mathematics and probability, you started wondering how unlikely this coincidence really is.

Each city picked uniformly at random another city to which they built a road. Calculate the probability that the road network ends up being connected.

입력

The first line contains an integer N (2 ≤ N ≤ 140) – the number of cities.

출력

Output one line containing a floating point number denoting the probability that the randomly built road network with N cities and N roads is connected. Your answer should have an absolute error of at most 10−8.

예제 입력 1

4

예제 출력 1

0.962962962963

예제 입력 2

2

예제 출력 2

1.000000000000

출처

Contest > KTH Challenge > KTH Challenge 2014 B번

  • 문제를 만든 사람: Lukáš Poláček