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

17802번 - Integral Pyramid 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 512 MB1681117865.000%

문제

Pascal’s triangle is a marvel of the combinatorical world, and what’s more you can easily build one for yourself at home.

The lowest row has n numbers. The next row is staggered and has n − 1 numbers, where the ith is the sum of the ith and the i + 1th on the previous row.

You can choose any positive integers for the lowest row, but the single cell on the top row needs to be equal to a given x. Is this possible?

입력

  • The only line contains the number of rows, n (1 ≤ n ≤ 20), and the value needed at the top, x (1 ≤ x ≤ 109).

출력

If a pyramid can be constructed, output all of the numbers on each row, starting from the top. Every number must be greater than or equal to 1.

Otherwise, output impossible.

제한

예제 입력 1

3 15

예제 출력 1

15
8 7
3 5 2

예제 입력 2

6 789

예제 출력 2

789
394 395
209 185 210
117 92 93 117
70 47 45 48 69
45 25 22 23 25 44

예제 입력 3

20 1

예제 출력 3

impossible

힌트

출처

ICPC > Regionals > Europe > Northwestern European Regional Contest > The UK & Ireland Programming Contest > UKIEPC 2019 I번

  • 문제를 만든 사람: Robin Lee
(追記) (追記ここまで)

출처

대학교 대회

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

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