Logo
(追記) (追記ここまで)

11204번 - Absurdistan Roads II 스페셜 저지다국어

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

문제

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
(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /