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

9820번 - Placement of Keys 다국어

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

문제

Assume that there are n (3 ≤ n ≤ 200) boxes identified by A1, A2,..., An, and each box Ai is configured a lock which is different from the others. Now put n keys to the n locks into the n boxes, each box can only hold a key. After locking all the boxes, unclench the boxes named A1, A2 and fetch out the keys in them to unlock the locked boxes. If the two keys can open some box, fetch out the key in the box to unlock other locked boxes again. If we can open all the boxes finally, we call the placement of the n keys good placement. How many are there different good placements of the n keys?

입력

The input file, ending with -1, contains several data, each of which holds a line.

출력

According to every input datum, compute the number of different good placements. Each output data hold two lines, the first line is held by the input datum, followed by a colon, which follows an equal mark before which is an N; the second is held by the number of different good placement of the n keys.

제한

예제 입력 1

6
8
-1

예제 출력 1

N=6:
240
N=8:
10080

힌트

출처

ICPC > Regionals > Asia East Continent > China > Xi'an > Xi'an Regional Contest 2002 H번

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

출처

대학교 대회

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

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