Subarray Problem

easy
1. You are given an array of size 'n' and n elements of the same array.
2. You are required to find and print all the subarrays of the given array. 
3. Each subarray should be space seperated and on a seperate lines. Refer to sample input and output.

Input Format

A number n n1 n2 .. n number of elements

Output Format

[Tab separated elements of subarray] .. All subarrays

Constraints

1 <= n <= 10
0 <= n1, n2
 .. n elements <= 10 ^9

Notice

Try First, Check Solution later

1. You should first read the question and watch the question video.
2. Think of a solution approach, then try and submit the question on editor tab.
3. We strongly advise you to watch the solution video for prescribed approach.

Example

Input
3
10
20
30
Output
10	
10	20	
10	20	30	
20	
20	30	
30	

Previous
Inverse Of An Array
Next
Subsets Of Array

Related Questions