Official

A - >< again Editorial by evima


Let \(d_i = \lvert A_{i-1}-A_i \rvert \) for each \(1 \leq i \leq N\). The magnitude relation between the \((i-1)\)-th and \(i\)-th elements is the same in \(A, B_1, \ldots, B_k\), so we have: \(d_i = \sum_{j=1}^k \lvert B_{j,i-1} - B_{j,i} \rvert \). Each term on the right side is at least \(1\), so it is necessary that \(k \leq d_i\). Thus, it is necessary that \(k \leq \min_{1 \leq i \leq N} d_i\).

Actually, we can construct \(B_1, \ldots, B_k\) for \(k = \min_{1 \leq i \leq N} d_i\). We can do it by dividing \(A_i\) as evenly as possible for each \(0 \leq i \leq N\). More specifically, we let \(B_{j,i} = \left\lfloor\frac{A_i+j-1}{k} \right\rfloor\). We can see that each \(B_j\) is a good non-negative integer sequence using the fact that \(k \leq d_i\).

posted:
last update: