Code for USACO practice problems
cpp
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

29 lines
392 B

#include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
if (n == 1) {
cout << 1;
return 0;
}
if (n == 2 || n == 3) {
cout << "NO SOLUTION";
return 0;
}
for (long long i = 1; i <= n; i++) {
if (i % 2 == 0) {
cout << i << " ";
}
}
for (long long i = 1; i <= n; i++) {
if (i % 2 == 1) {
cout << i << " ";
}
}
}