Interesting Patterns
Basic Accuracy: 31.5% Submissions: 2849 Points: 1

Given an integer N. Your task is to print the pattern.
For example:
Input N=4 
Output : 
4444444 
4333334 
4322234 
4321234 
4322234 
4333334 
4444444 

Input N=3 
Output : 
 33333 
 32223 
 32123 
 32223 
 33333
 
Input:
First line consists of test cases.For each test case only one line be the input containing an integer N.

Output:
For each test case. Print the pattern in single line by giving space instead of new line.

Constraints:
1<=T<=20
1<=N<=20

Example:
Input

1
4

Output
4444444 4333334 4322234 4321234 4322234 4333334 4444444

to report an issue on this page.

Editorial

We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?

Yes

All Submissions

My Submissions:

Login to access your submissions.