forked from kishanrajput23/leetcode-solutions-1
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathThickness.cpp
More file actions
41 lines (39 loc) · 807 Bytes
/
Thickness.cpp
File metadata and controls
41 lines (39 loc) · 807 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include <bits/stdc++.h>
using namespace std;
int main()
{
int x1;
cin >> x1;
while (x1--)
{
int x;
cin >> x;
if (x == 3)
cout << "-1" << endl;
else
{
if (x % 2)
{
int kas = (x / 2) + 1;
for (int j = x; j > kas; j--)
{
cout << i << " ";
}
for (int j = 1; j <= kas; j++)
{
cout << j << " ";
}
cout << endl;
}
else
{
for (int k = x; k >= 1; k--)
{
cout << k << " ";
}
cout << endl;
}
}
}
return 0;
}