#C6964. Chunk Array
Chunk Array
Chunk Array
You are given an array of integers and an integer \( n \) representing the chunk size. Your task is to split the array into subarrays (chunks) where each chunk is of size \( n \) except possibly the last one, which may have fewer elements.
Example:
Input: 6 1 2 3 4 5 6 2</p>Output: 1 2 3 4 5 6
If the array is empty, the output should be empty. The input is read from standard input (stdin) and the output should be printed on standard output (stdout).
inputFormat
The input consists of three lines:
- An integer \( L \) representing the number of elements in the array.
- If \( L > 0 \), a line with \( L \) space-separated integers.
- An integer \( n \) representing the chunk size.
outputFormat
Output the chunked subarrays, one per line. Each line should contain the elements of a chunk separated by a single space. If the array is empty, output nothing.
## sample6
1 2 3 4 5 6
2
1 2
3 4
5 6
</p>