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

9816번 - Number of Locks 다국어

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

문제

In certain factory a kind of spring locks is manufactured. There are n slots (1 < n < 17, n is a natural number.) for each lock. The height of each slot may be any one of the 4 values in{1,2,3,4}( neglect unit ). Among the slots of a lock there are at least one pair of neighboring slots with their difference of height equal to 3 and also there are at least 3 different height values of the slots for a lock. If a batch of locks is manufactured by taking all over the 4 values for slot height and meet the two limitations above, find the number of the locks produced.

입력

There is one given data n (number of slots) on every line. At the end of all the input data is -1, which means the end of input.

출력

According to the input data, count the number of locks. Each output occupies one line. Its fore part is a repetition of the input data and then followed by a colon and a space. The last part of it is the number of the locks counted.

제한

예제 입력 1

2
3
-1

예제 출력 1

2: 0
3: 8

힌트

출처

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

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

출처

대학교 대회

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

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