#K6496. Unique Subarrays
Unique Subarrays
Unique Subarrays
Your task is to compute all unique subarrays of a given array of integers. A subarray is defined as a contiguous segment of the array. You must output each unique subarray in a specific sorted order: first, sort the subarrays by their length in increasing order; then, for subarrays of the same length, sort them in lexicographical order (i.e. element by element comparison).
Note: Two subarrays are considered the same if they have equal length and their corresponding elements are identical.
This problem is intended to test your ability to generate and manipulate subarrays and to implement sorting with custom criteria. Make sure your solution reads from standard input (stdin) and writes to standard output (stdout).
inputFormat
The first line contains an integer n representing the number of elements in the array. The second line contains n space-separated integers representing the array elements.
outputFormat
Print each unique subarray on a separate line. Each subarray must be printed as space-separated integers. The subarrays should be sorted in increasing order of their length, and for subarrays of the same length, in lexicographical order.
## sample1
1
1
</p>