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

34485번 - Stacking Cups 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 2048 MB17111173.333%

문제

You have a collection of $n$ cylindrical cups, where the $i$th cup is 2ドルi−1$ cm tall. The cups have increasing diameters, such that cup $i$ fits inside cup $j$ if and only if $i < j$. The base of each cup is 1ドル$ cm thick (which makes the smallest cup rather useless as it is only 1ドル$ cm tall, but you keep it for sentimental reasons).

After washing all the cups, you stack them in a tower. Each cup is placed upright (in other words, with the opening at the top) and with the centers of all the cups aligned vertically. The height of the tower is defined as the vertical distance from the lowest point on any of the cups to the highest. You would like to know in what order to place the cups such that the final height (in cm) is your favorite number. Note that all $n$ cups must be used.

For example, suppose $n = 4$ and your favorite number is 9ドル$. If you place the cups of heights 7ドル,ドル 3ドル,ドル 5ドル,ドル 1ドル,ドル in that order, the tower will have a total height of 9ドル,ドル as shown in Figure J.1.

Figure J.1: Illustration of Sample Output 1.

입력

The input consists of a single line containing two integers $n$ and $h,ドル where $n$ (1ドル ≤ n ≤ 2 \cdot 10^5$) is the number of cups and $h$ (1ドル ≤ h ≤ 4 \cdot 10^{10}$) is your favorite number.

출력

If it is possible to build a tower with height $h,ドル output the heights of all the cups in the order they should be placed to achieve this. Otherwise, output impossible. If there is more than one valid ordering of cups, any one will be accepted.

제한

예제 입력 1

4 9

예제 출력 1

7 3 5 1

예제 입력 2

4 100

예제 출력 2

impossible

노트

출처

ICPC > World Finals > ICPC World Finals 2025 J번

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

출처

대학교 대회

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

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