AtCoder Regular Contest 084
E
Finite Encyclopedia of Integer Sequences
AtCoder
⌀ 2703
原题
←F →
翻译中…

Problem Statement

翻译中…

In Finite Encyclopedia of Integer Sequences (FEIS), all integer sequences of lengths between $1$ and $N$ (inclusive) consisting of integers between $1$ and $K$ (inclusive) are listed.

翻译中…

Let the total number of sequences listed in FEIS be $X$. Among those sequences, find the $(X/2)$-th (rounded up to the nearest integer) lexicographically smallest one.

翻译中…

Constraints

翻译中…
  • $1 \leq N,K \leq 3 × 10^5$
  • $N$ and $K$ are integers.
翻译中…

Input

翻译中…

Input is given from Standard Input in the following format:

翻译中…

K N

翻译中…

Output

翻译中…

Print the $(X/2)$-th (rounded up to the nearest integer) lexicographically smallest sequence listed in FEIS, with spaces in between, where $X$ is the total number of sequences listed in FEIS.

翻译中…

样例

Input #1
3 2
Output #1
2 1
There are $12$ sequences listed in FEIS: $(1),(1,1),(1,2),(1,3),(2),(2,1),(2,2),(2,3),(3),(3,1),(3,2),(3,3)$. The $(12/2 = 6)$-th lexicographically smallest one among them is $(2,1)$.
Input #2
2 4
Output #2
1 2 2 2
Input #3
5 14
Output #3
3 3 3 3 3 3 3 3 3 3 3 3 2 2
题目信息
题号
arc084_c
时间限制
2 s
内存限制
256 MB

题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。