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

8410번 - Meeting 다국어

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

문제

During the second congress of Paranoiac Informatics Society (called simply a meeting), all members took their places round a round table. One of the members posed the following question: "What is the number of ways we can shake our hands without leaving our places? Every participant can shake hand of one person and this person must be his/her neighbour."

Since the congress participants are theoreticians, they asked you to write a program, which computes this number of ways. The participants hate big numbers, so they need only the last digit of the result.

Write a program, which:

  • reads the number of congress participants from the standard input,
  • computes the last digit of the number of ways the participants can shake hands,
  • writes the answer to the standard output.

입력

The first and only line of the standard input contains one integer n (3 ≤ n ≤ 2 000 000 000), denoting the number of members.

출력

The first and only line of the standard output should contain one digit, i.e. the last digit of the number of ways the participants can shake hands.

제한

예제 입력 1

4

예제 출력 1

7

힌트

All possible ways of shaking hands.

출처

Contest > Algorithmic Engagements > PA 2006 7-0번

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

출처

대학교 대회

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

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