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

16650번 - Counting Stairs 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
3 초 512 MB2851148034.483%

문제

Remember Barney from problem B? Barney’s older sister Cecilia often watches him play with his set of cubes. She also joins Barney in his games and prevails most of the time, shaking his confidence on a daily basis.

One day Cecilia noticed Barney struggling to build a symmetric stair with his n cubes. She immediately told him she could not just build a symmetric stair, but even calculate the number of different symmetric stairs consisting of n cubes! Can you?

Recall that a symmetric stair consists of one or more towers of cubes, where the heights of towers are non-increasing from left to right, and is symmetric with respect to the x = y line (where the x-axis is horizontal and oriented to the right, and the y-axis is vertical and oriented upwards). For a more detailed explanation, please refer to problem B statement.

The number of different symmetric stairs can be quite large, so you need to calculate it modulo 998 244 353.

입력

The input contains multiple test cases.

The first line of the input contains a single integer t — the number of test cases (1 ≤ t ≤ 104). Each of the following t lines contains a single integer ni — the number of cubes in the i-th test case (1 ≤ ni ≤ 2 · 105).

출력

For each test case, output a line with a single integer — the number of symmetric stairs with exactly ni cubes, modulo 998 244 353.

제한

예제 입력 1

4
3
5
17
25

예제 출력 1

1
1
5
12

노트

All different symmetric stairs with n = 17 cubes are shown below:

출처

ICPC > Regionals > Northern Eurasia > Northwestern Russia Regional Contest > NEERC Northern Subregional 2018 C번

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

출처

대학교 대회

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

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