Language: C++

#include <bits/stdc++.h>
using namespace std;
#define min(a,b) ((a)<(b)?(a):(b))
#define max(a,b) ((a)>(b)?(a):(b))
#define REP(i,n) for(int i=0;i<n;i++)
#define FOR(i,n1,n2) for(int i=n1;i<n2;i++)
#define speed_up    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
typedef pair<int,int> Pi;
typedef long long int ll;
const int INF=(ll)(1LL<<31)-1;
const ll INFl=(ll)9223372036854775807;
const int MAX=10000;
const ll MOD=(ll)1e9+7;
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a, b)*b;}
int dx[4]={1,0,-1,0},dy[4]={0,1,0,-1};

template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}

int m,k;

int main(){
	cin>>m>>k;
	if(k!=0){
		if(m==3||m==7||m==15){
			if((k<m)&&(k==1||k==3||k==7||k==15)){
				cout<<k<<" ";
				for(int i=m;i>=0;i--){
					if(i!=k)
						cout<<i<<" ";
				}
				cout<<k<<" ";
				for(int i=0;i<=m;i++){
					if(i!=k)
					cout<<i<<" ";
				}
				#include <bits/stdc++.h>
using namespace std;
#define min(a,b) ((a)<(b)?(a):(b))
#define max(a,b) ((a)>(b)?(a):(b))
#define REP(i,n) for(int i=0;i<n;i++)
#define FOR(i,n1,n2) for(int i=n1;i<n2;i++)
#define speed_up    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
typedef pair<int,int> Pi;
typedef long long int ll;
const int INF=(ll)(1LL<<31)-1;
const ll INFl=(ll)9223372036854775807;
const int MAX=10000;
const ll MOD=(ll)1e9+7;
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a, b)*b;}
int dx[4]={1,0,-1,0},dy[4]={0,1,0,-1};

template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}

int m,k;

int main(){
	cin>>m>>k;
	if(k!=0){
		if(m==3||m==7||m==15){
			if((k<m)&&(k==1||k==3||k==7||k==15)){
				cout<<k<<" ";
				for(int i=m;i>=0;i--){
					if(i!=k)
						cout<<i<<" ";
				}
				cout<<k<<" ";
				for(int i=0;i<=m;i++){
					if(i!=k)
					cout<<i<<" ";
				}
				cout<<endl;
				return 0;
			}
		}
	}else{
		for(int i=0;i<=m;i++){
			cout<<i<<" "<<i<<" ";
		}
		cout<<endl;
		return 0;
	}
	cout<<-1<<endl;
	return 0;
}

			}
		}
	}else{
		for(int i=0;i<=m;i++){
			cout<<i<<" "<<i<<" ";
		}
		cout<<endl;
		return 0;
	}
	cout<<-1<<endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:53:18: error: a function-definition is not allowed here before '{' token
   53 | ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
      |                  ^
a.cc:54:18: error: a function-definition is not allowed here before '{' token
   54 | ll lcm(ll a,ll b){return a/gcd(a, b)*b;}
      |                  ^
a.cc:57:1: error: a template declaration cannot appear at block scope
   57 | template<typename A, size_t N, typename T>
      | ^~~~~~~~
a.cc:64:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   64 | int main(){
      |         ^~
a.cc:64:9: note: remove parentheses to default-initialize a variable
   64 | int main(){
      |         ^~
      |         --
a.cc:64:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:64:11: error: a function-definition is not allowed here before '{' token
   64 | int main(){
      |           ^