Alice Paints Her Fence
Alice wants to paint her fence, which consists of n sections arranged in a line. She has k paint colors available, numbered 1 to k. Her constraint is strict: no two adjacent sections may have the same color. Alice asks you whether it's possible to paint all sections, and if so, to produce a valid coloring.
Input
The first line contains two integers n and k (1 ≤ n ≤ 10^5, 0 ≤ k ≤ 10^5).
Output
If it's possible to color all n sections using at most k colors such that no two adjacent sections have the same color, print a valid coloring as n space-separated integers, where each integer is in the range [1, k]. If it's impossible, print NO. If there are several valid colorings, print any of them.
Notes
The first example has n = 3 and k = 2, requiring a valid 2-coloring of a path of 3 nodes. One valid answer is 1 2 1, which alternates colors; 2 1 2 is accepted too. The second example has n = 2 and k = 1, which is impossible because two adjacent sections cannot both have color 1.