#C2320. Lexicographically Smallest Palindromic Array
Lexicographically Smallest Palindromic Array
Lexicographically Smallest Palindromic Array
Given two integers \(n\) and \(k\), your task is to generate the lexicographically smallest palindromic array of length \(n\) using any integer values from 1 to \(k\). An array \(A\) is palindromic if it satisfies \(A_i = A_{n-i+1}\) for every valid index \(i\). Since the smallest number available is 1, the lexicographically smallest such array is simply an array of ones.
Example: For \(n = 5\) and \(k = 3\), the answer is:
[1, 1, 1, 1, 1]
inputFormat
The input is provided via standard input (stdin) as a single line containing two space-separated integers \(n\) and \(k\):
- \(n\) – the length of the desired palindromic array.
- \(k\) – the maximum integer that can be used (range from 1 to \(k\)).
outputFormat
Output the lexicographically smallest palindromic array of length \(n\) to standard output (stdout). The array's elements should be printed as space-separated integers on a single line.
## sample5 3
1 1 1 1 1
</p>