There was an error while loading. Please reload this page.
2 parents 550403b + c64ca47 commit 5fdac30Copy full SHA for 5fdac30
ONLINE JUDGE/CodeChef Challenges/PERMCREATE.cpp
@@ -0,0 +1,34 @@
1
+#include <iostream>
2
+using namespace std;
3
+
4
+int main() {
5
+// your code goes here
6
7
+long long number;
8
+cin >> number;
9
+ for(int i = 0; i < number; i++){
10
+ long long a;
11
+ cin >> a;
12
+ if(a < 4){
13
+ cout << -1 << endl;
14
+ }
15
+ else if( a == 4){
16
+ cout << 2 << " " << 4 << " " << 1 << " " << 3 ;
17
18
+ else{
19
+ for(long long i = 1; i <= a; i = i+2){
20
+ cout << i << " " ;
21
22
+ for(long long i = 2; i <= a; i = i+2){
23
+ cout << i << " ";
24
25
26
+ cout << endl;
27
28
29
30
31
32
33
+return 0;
34
+}
0 commit comments