#C6964. Chunk Array

    ID: 50782 Type: Default 1000ms 256MiB

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

Output: 1 2 3 4 5 6

</p>

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:

  1. An integer \( L \) representing the number of elements in the array.
  2. If \( L > 0 \), a line with \( L \) space-separated integers.
  3. 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.

## sample
6
1 2 3 4 5 6
2
1 2

3 4 5 6

</p>