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

6362번 - Unimodal Palindromic Decompositions 다국어

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

문제

A sequence of positive integers is Palindromic if it reads the same forward and backward. For example:

  • 23 11 15 1 37 37 1 15 11 23
  • 1 1 2 3 4 7 7 10 7 7 4 3 2 1 1

A Palindromic sequence is Unimodal Palindromic if the values do not decrease up to the middle value and then (since the sequence is palindromic) do not increase from the middle to the end For example, the first example sequence above is NOT Unimodal Palindromic while the second example is.

A Unimodal Palindromic sequence is a Unimodal Palindromic Decomposition of an integer N, if the sum of the integers in the sequence is N. For example, all of the Unimodal Palindromic Decompositions of the first few integers are given below:

  1. (1)
  2. (2), (1 1)
  3. (3), (1 1 1)
  4. (4), (1 2 1), (2 2), (1 1 1 1)
  5. (5), (1 3 1), (1 1 1 1 1)
  6. (6), (1 4 1), (2 2 2), (1 1 2 1 1), (3 3), (1 2 2 1), ( 1 1 1 1 1 1)
  7. (7), (1 5 1), (2 3 2), (1 1 3 1 1), (1 1 1 1 1 1 1)
  8. (8), (1 6 1), (2 4 2), (1 1 4 1 1), (1 2 2 2 1), (1 1 1 2 1 1 1), (4 4), (1 3 3 1), (2 2 2 2), (1 1 2 2 1 1), (1 1 1 1 1 1 1 1)

Write a program, which computes the number of Unimodal Palindromic Decompositions of an integer.

입력

Input consists of a sequence of positive integers, one per line ending with a 0 (zero) indicating the end.

출력

For each input value except the last, the output is a line containing the input value followed by a space, then the number of Unimodal Palindromic Decompositions of the input value.

제한

  • 1 ≤ N ≤ 250

예제 입력 1

2
3
4
5
6
7
8
10
23
24
131
213
92
0

예제 출력 1

2 2
3 2
4 4
5 3
6 7
7 5
8 11
10 17
23 104
24 199
131 5010688
213 1055852590
92 331143

힌트

출처

ICPC > Regionals > North America > Greater New York Region > 2002 Greater New York Programming Contest E번

  • 빠진 조건을 찾은 사람: kyo20111
(追記) (追記ここまで)

출처

대학교 대회

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

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