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

17872번 - How Many Unicycles in a Wheel? 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 512 MB20181588.235%

문제

A Wheel Graph of size n is a cycle of n vertices each of which is connected to a center vertex. Examples of wheel graphs of size 4,5,6 and 8 are shown below:

A spanning unicycle in a graph, G, is a spanning tree in G with one additional edge added to form a single cycle. Each of the examples below is a spanning unicycle in a wheel graph of size 5:

Write a program to compute the number of different unicycles in a wheel graph of size n. Recall that two subgraphs, S1 and S2, of a graph G are different if there is at least one edge of G that is in S1 and not in S2 OR an edge in S2 which is not in S1.

입력

Input consists of a single line that contains a decimal integer, m (3 <= m <= 4000), which is the size of the wheel graph to find the number of unicycles of.

출력

The single output line consists of the count of unicycles modulo 100007 for the input size m.

제한

예제 입력 1

5

예제 출력 1

170

예제 입력 2

1234

예제 출력 2

17511

힌트

출처

ICPC > Regionals > North America > Greater New York Region > 2019 Greater New York Programming Contest J번

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

출처

대학교 대회

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

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