criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include <bits/stdc++.h>
#include <cstdlib>
#include <cmath>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;
const ll INF=1e18 ;
inline void chmax(ll& a,ll b){a=max(a,b);}
inline void chmin(ll& a,ll b){a=min(a,b);}
int main() {
    ll n,m ;
    cin >> n>> m;
  if(n%2==0){
      if(n%4==0){
          ll k= n/4
          for(ll i=1;i<=k;i++){
              cout<<i<<" "<<n-i+1<<endl;
          }for (ll j=k+1;j<=m;j++){
          cout <<j<<" "<<n-j<<endl;
          
      }
      }
  else{
   ll k= (n/4);
   for(ll i=1;i<=k;i++){
       cout <<i<<" "<<n-i+1<<endl ;
  } for(ll j=k+1;j<=m;j++){
       cout<<j<<" "<<n-j<<endl ;
   
   }
  }
  }  
 else{
  rep(i,m){
  cout <<i+1<<" "<<n-i<<endl ; 
  } 
 }return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:11: error: expected ',' or ';' before 'for'
   17 |           for(ll i=1;i<=k;i++){
      |           ^~~
a.cc:17:22: error: 'i' was not declared in this scope
   17 |           for(ll i=1;i<=k;i++){
      |                      ^
Language: C++

#include <bits/stdc++.h>
#include <cstdlib>
#include <cmath>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;
const ll INF=1e18 ;
inline void chmax(ll& a,ll b){a=max(a,b);}
inline void chmin(ll& a,ll b){a=min(a,b);}
ll main() {
    ll n,m ;
    cin >> n>> m;
  if(n%2==0){
      if(n%4==0){
          for(ll i=1;i<=(n/4);i++){
              cout<<i<<" "<<n-i+1<<endl;
          }for (ll j=(n/4)+1;j<=m;j++){
          cout <<j<<" "<<n-j<<endl;
          
      }
      }
  else{
   ll k= (n/4);
   for(ll i=1;i<=k;i++){
       cout <<i<<" "<<n-i+1<<endl ;
  } for(ll j=k+1;j<=m;j++){
       cout<<j<<" "<<n-j<<endl ;
   
   }
  }
  }  
 else{
  rep(i,m){
  cout <<i+1<<" "<<n-i<<endl ; 
  } 
 }return 0;

}

Compiler output:
a.cc:11:1: error: '::main' must return 'int'
   11 | ll main() {
      | ^~
Language: C++

#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vll>;
using vvvll = vector<vvll>;

#define REP(i, n, m) for(ll i=n; i<(ll)m; ++i)
#define IREP(i, n, m) for(ll i=n-1; i>=m; --i)
#define rep(i, n) REP(i, 0, n)
#define irep(i, n) IREP(i, n, 0)
#define all(v) v.begin(), v.end()
#define vprint(v) for(auto e:v){cout<<e<<" ";};cout<<endl;
#define vvprint(vv) for(auto v:vv)vprint(v);

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << setprecision(20);

    ll N, M;
    cin >> N >> M;

    if(N%2==1){
        rep(i, M) cout << (i+1) << " " << (N-i) << endl;
    }
    else{
        rep(i, M){
            if(2*i=<N/2) cout << (i+1) << " " << (N-i) << endl;
            else cout << (i+1) << " " << (N-i-1) << endl;
        }
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:30:20: error: expected primary-expression before '<' token
   30 |             if(2*i=<N/2) cout << (i+1) << " " << (N-i) << endl;
      |                    ^
Language: C++

#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef vector<ll> vl ;
typedef vector<int> vi;
typedef pair<int, int> pi;
typedef pair<ll,ll> pl;

#define rep(i,N) for(int i=0; i < (int)N; i++)
#define all(v) (v).begin(),(v).end()

const int INF = 100000002;

int main(){
	int n, m; cin >> n >> m;
	vector<pi> ans;
	if (n%2) { 
		for(int l = 1, r=n-1; r < r; l++, r--){
			ans.emplace_back(l,r);
		}
	}else{
		bool falg = false;
		for(int l=1, r=n-1; l < r; l++, r--){
			if(!falg && r-l <= n/2){
				--r;
				flag = true;
			}
			ans.emplace_back(l,r);
		}
	}
	rep(i,m){
		printf("%d %d\n", ans[i].first, a[i].first);
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:33: error: 'flag' was not declared in this scope; did you mean 'falg'?
   27 |                                 flag = true;
      |                                 ^~~~
      |                                 falg
a.cc:33:49: error: 'a' was not declared in this scope
   33 |                 printf("%d %d\n", ans[i].first, a[i].first);
      |                                                 ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define all(t) t.begin(), t.end()
#define inrange(i, a, b) (((i)>= min((a), (b))) && ((i) <= max((a), (b))))
typedef vector<ll> vi;
#define fi first
#define se second
const ll inf = 9e18;
const ll mod = 1e9 + 7;

void print(ll a[], ll n){for(ll i=0;i<n;i++){cout<<a[i]<<" ";}cout<<"\n";}
ll power(ll x, ll y, ll M = inf){
    ll ans = 1;
    x %= M;
    while(y){
        if(y&1)
            ans = (x * ans) % M;

        x = (x * x) % M;
        y >>= 1;
    }
    return ans;
}
ll modInverse(ll n) {return power(n, mod-2, mod);}
inline ll mul(ll a, ll b){ return (a * b) % mod; }
inline ll sub(ll a, ll b){ ll c = a - b; if(c < 0) c += mod; return c; }
inline ll add(ll a, ll b){ ll c = a + b; if(c > mod) c -= mod; return c; }
inline ll divi(ll a, ll b){ return mul(a, modInverse(b)); }

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);

    ll n , m;
    cin>>n>>m;
    
	for (int i = 1, j = m; i < j; i++, j--){
        cout<<i<<" "<<j<<"\n";
	}
    for (i = m + 1, j = 2 * m + 1; i < j; i++, j--){
        cout<<i<<" "<<j<<"\n";
    }
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:42:10: error: 'i' was not declared in this scope
   42 |     for (i = m + 1, j = 2 * m + 1; i < j; i++, j--){
      |          ^
a.cc:42:21: error: 'j' was not declared in this scope
   42 |     for (i = m + 1, j = 2 * m + 1; i < j; i++, j--){
      |                     ^
Language: C

include<stdio.h>
 
int main(){
  int N,M,i;
  int a_i;
  int b_i;
  int bs;
  int flag=0;
     
  scanf("%d %d",&N,&M);
  bs=N+1;
  
  if(N%2==1){
    for(i=1;i<=M;i++){
      a_i=i;
      b_i=bs-1;
      bs=bs-1;
    printf("%d %d\n",a_i,b_i);
    }
  } else {
      for(i=1;i<=M;i++){
	  a_i=i;
        if(i==(M+1)/2 && flag==0){
          bs=bs-1;
          flag=1;
        }
      b_i=bs-1;
      bs=bs-1;
    printf("%d %d\n",a_i,b_i);
    }
  }
  
 return 0; 
}

Compiler output:
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include<stdio.h>
      |        ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n,m;
  cin>>n>>m;
  for(int i=;i<=m;i++){
    cout<<i<<" "<<n+1-i<<endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:13: error: expected primary-expression before ';' token
    6 |   for(int i=;i<=m;i++){
      |             ^
Language: C++

#include<bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < n; ++i)
using namespace std;

int main(){
  int n, m, c = 0; cin >> n >> m;
  rep(i, m){
    if(b-a == n/2 && n % 2 == 0) c = 2;
    int a = i+1, b = n-i-c;
    cout << a << " " << b << "\n";
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:8: error: 'b' was not declared in this scope
    8 |     if(b-a == n/2 && n % 2 == 0) c = 2;
      |        ^
a.cc:8:10: error: 'a' was not declared in this scope
    8 |     if(b-a == n/2 && n % 2 == 0) c = 2;
      |          ^
Language: C++

#include<bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < n; ++i)
#define rrep(i, n) for(int i = n-1; i >= 0; --i)
#define fi first
#define se second
using namespace std;
using lint = long long;
using uint = unsigned int;
using ulint = unsigned long long;
using ldouble = long double;
using pii = pair<int, int>;
using pli = pair<lint, lint>;
using pdd = pair<double, double>;
using pld = pair<ldouble, ldouble>;
using v1i = vector<int>;
using v1li = vector<lint>;
using v2i = vector<vector<int>>;
using v2li = vector<vector<lint>>;
using v3i = vector<vector<vector<int>>>;
using v3li = vector<vector<vector<lint>>>;
using v1b = vector<bool>;
using v2b = vector<vector<bool>>;
using v3b = vector<vector<vector<bool>>>;
using v1c = vector<char>;
using v2c = vector<vector<char>>;
using v3c = vector<vector<vector<char>>>;
constexpr lint mod1 = 1e9+7;
constexpr lint mod2 = 998244353;

int main(){
  int n, m, c = 0; cin >> n >> m;
  rep(i, m){
    if(b-a == n/2 && n % 2 == 0) c = 2;
    int a = i+1, b = n-i-c;
    cout << a << " " << b << "\n";
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:33:8: error: 'b' was not declared in this scope
   33 |     if(b-a == n/2 && n % 2 == 0) c = 2;
      |        ^
a.cc:33:10: error: 'a' was not declared in this scope
   33 |     if(b-a == n/2 && n % 2 == 0) c = 2;
      |          ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
int a,b;
  cin>>a>>b;
for(int i=0;i<b;i++){cout<<1+i<<" "<<2b-i<<endl;}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:38: error: unable to find numeric literal operator 'operator""b'
    7 | for(int i=0;i<b;i++){cout<<1+i<<" "<<2b-i<<endl;}
      |                                      ^~
Language: C

#include <cstdio>

int main(void)
{
    int n, m, f, e;

    scanf("%d %d", &n, &m);

    for (f = 1, e = m; f < e; f++, e--)
        printf("%d %d\n", f, e);
    for (f = m + 1, e = 2 * m + 1; f < e; f++, e--)
        printf("%d %d\n", f, e);
    return 0;
}

Compiler output:
main.c:1:10: fatal error: cstdio: No such file or directory
    1 | #include <cstdio>
      |          ^~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
    long long N, M;
    cin >> N >> M;
    if(N % 2 == 1){
        for(int i = 0; i < M; i++){
            cout << 1 + i << ' ' << N - i << endl;
        }
    }
    else{
        for(int i = 0; i < M; i++){
            if(i <= M / 2) cout << 1 + i << ' ' << N - i << endl;
            else cout << 2 + i << ' ' << N - i << endl;
        }
    }

Compiler output:
a.cc: In function 'int main()':
a.cc:16:6: error: expected '}' at end of input
   16 |     }
      |      ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

main()
{
	int n >> m;
    cin >> n >> m;
    
    vector <pair <int, int> > v;
    
    for(int i = 1; j = n / 2; i < j; ++i, --j)
    	v.emplace_back(i, j);
    
    for(int i = n / 2 + 1, j = n, i < j; ++i, --j)
    	v.emplace_back(i, j);
    
    for(int i = 0; i < m; ++i)
    	cout << v[i].first << ' ' << v[i].second << '\n';
}

Compiler output:
a.cc:5:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    5 | main()
      | ^~~~
a.cc: In function 'int main()':
a.cc:7:15: error: expected initializer before '>>' token
    7 |         int n >> m;
      |               ^~
a.cc:8:12: error: 'n' was not declared in this scope; did you mean 'yn'?
    8 |     cin >> n >> m;
      |            ^
      |            yn
a.cc:8:17: error: 'm' was not declared in this scope; did you mean 'tm'?
    8 |     cin >> n >> m;
      |                 ^
      |                 tm
a.cc:12:20: error: 'j' was not declared in this scope
   12 |     for(int i = 1; j = n / 2; i < j; ++i, --j)
      |                    ^
a.cc:12:36: error: expected ')' before ';' token
   12 |     for(int i = 1; j = n / 2; i < j; ++i, --j)
      |        ~                           ^
      |                                    )
a.cc:12:40: error: 'i' was not declared in this scope
   12 |     for(int i = 1; j = n / 2; i < j; ++i, --j)
      |                                        ^
a.cc:12:45: error: 'j' was not declared in this scope
   12 |     for(int i = 1; j = n / 2; i < j; ++i, --j)
      |                                             ^
a.cc:15:50: error: expected ';' before ')' token
   15 |     for(int i = n / 2 + 1, j = n, i < j; ++i, --j)
      |                                                  ^
      |                                                  ;
Language: C++

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sstream>
#include <iostream>
#include <math.h>
#include <time.h>
#include <unistd.h>
#include <algorithm>
#include <map>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <set>
#include <string>
 
#ifndef ONLINE_JUDGE
	#define DEBUG(x) cout << '>' << #x << ':' << x << endl;
#else
	#define DEBUG(x) do {} while(0);
#endif
 
#define pb push_back
#define mp make_pair
#define ALL(x) (x).begin(), (x).end()
#define PER(i, N) for(int (i) = (N)-1; (i) >= 0; (i)--)
#define REP(i, N) for(int (i) = 0; (i) < (int)(N); (i)++)
 #include <iomanip>
using namespace std;
typedef long long ll;
inline bool EQ(double a, double b) { return fabs(a-b) < 1e-9; }

template <typename T, typename U> std::istream&operator>>(std::istream&i, pair<T,U>&p) {i >> p.x >> p.y; return i;}
template<typename T>std::istream&operator>>(std::istream&i,vector<T>&t) {for(auto&v:t){i>>v;}return i;}
template <typename T, typename U> std::ostream&operator<<(std::ostream&o, const pair<T,U>&p) {o << p.x << ' ' << p.y; return o;}
template<typename T>std::ostream&operator<<(std::ostream&o,const vector<T>&t) {if(t.empty())o<<'\n';for(size_t i=0;i<t.size();++i){o<<t[i]<<" \n"[i == t.size()-1];}return o;}
template<typename T> using minheap = priority_queue<T, vector<T>, greater<T>>;
template<typename T> using maxheap = priority_queue<T, vector<T>, less<T>>;
template<typename T> T gcd(T a,T b) { if (a<b) swap(a,b); return b?gcd(b,a%b):a; }

int n, m;//n,m;

void solve(istream& cin, ostream& cout) {
//	cin >>n>>m;
	cin >> n>>m;
	/*
	for(int r1 = 0; r1 < n; r1++) {
		for(int r2 = 0; r2 < n; r2++) {
			if(r1 >= r2)
				continue;
			
			REP(j, m) {
				int p1 = j, p2 = 2*m-j-1;
				int A1 = (p1+n-r1)%n, B1 = (p2+n-r1)%n;
				int A2 = (p1+n-r2)%n, B2 = (p2+n-r2)%n;
				if((A1 == A2 && B1 == B2) || (A1 == B2 && A2 == B1)) {
					cout << "rounds " << r1 << " " << r2 << " " << j << endl;
				}
			}
		}
	}*/
	REP(i, m) {
		int u = 2*m-i;
		if(n%(2*m-2*j-1) == 0 && n/(2*m-2*j-1) == 2) u++;
		cout << (i+1) << " " << u <<endl;
	}
}


int main() {
    ios_base::sync_with_stdio(false);
	cin.tie(nullptr); cout.tie(nullptr);
	solve(cin, cout);
	/*
	{
		istringstream instr("2\n2\n14");
		solve(instr, cout);
	}
 */
	return 0;
}


Compiler output:
a.cc: In function 'void solve(std::istream&, std::ostream&)':
a.cc:65:29: error: 'j' was not declared in this scope
   65 |                 if(n%(2*m-2*j-1) == 0 && n/(2*m-2*j-1) == 2) u++;
      |                             ^
Language: C++

#include <iostream>
using namespace std;
int N;
int M;
int main(void){
  cin >> N >> M;
  if N % 2 == 1{
    for(int i = 1; i < M + 1,i++){
      cout << i << " " << N - i << endl;
    }
  }
  else {
    for(int i = 1; i < M + 1,i++){
      if(i == N / 2 - 1)
        cout << N / 2 << " " << N / 2 + 1 << endl;
      else
        cout << i << " " << N - i << endl;
    }
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:6: error: expected '(' before 'N'
    7 |   if N % 2 == 1{
      |      ^
      |      (
a.cc:12:3: error: 'else' without a previous 'if'
   12 |   else {
      |   ^~~~
a.cc:13:33: error: expected ';' before ')' token
   13 |     for(int i = 1; i < M + 1,i++){
      |                                 ^
      |                                 ;
Language: C

int main(void)
{
  int n, m;
  scanf("%d %d", &n, &m);
  
  int i;
  for (i = 1; i <= m; i++)
  {
    if (n % 2 != 0)
      printf("%d %d\n", i, n - i);
    else
      printf("%d %d\n", i, n + 1 - i)
  }
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:4:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    4 |   scanf("%d %d", &n, &m);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | int main(void)
main.c:4:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    4 |   scanf("%d %d", &n, &m);
      |   ^~~~~
main.c:4:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:10:7: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   10 |       printf("%d %d\n", i, n - i);
      |       ^~~~~~
main.c:10:7: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:10:7: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:10:7: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:12:7: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   12 |       printf("%d %d\n", i, n + 1 - i)
      |       ^~~~~~
main.c:12:7: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:12:38: error: expected ';' before '}' token
   12 |       printf("%d %d\n", i, n + 1 - i)
      |                                      ^
      |                                      ;
   13 |   }
      |   ~
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int INF = 0x3f3f3f3f;
const int N = 50 + 5;

int main(){
	int n,m;
	cin >> n >> m;
	if(n%2 == 1){
		for(int i = 0; i < m; i++)
			cout << i+1 << " " << n-i << endl;
	else{
		for(int i = 0; i < n/4; ++i){
			if(i == m)	break;
			cout << i+1 << " " << n-i << endl;
		}
		for(int i = n/4; i < m; ++i)
			cout << i+1 << " " << n-i-1 << endl;
	}
	return 0;
}
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:9: error: expected '}' before 'else'
   13 |         else{
      |         ^~~~
a.cc:10:21: note: to match this '{'
   10 |         if(n%2 == 1){
      |                     ^
a.cc: At global scope:
a.cc:24:9: error: expected unqualified-id before 'return'
   24 |         return 0;
      |         ^~~~~~
a.cc:25:1: error: expected declaration before '}' token
   25 | }
      | ^
Language: C++

#include <bits/stdc++.h>
#include <algorithm>
#include <math.h>
#define rep(i, n) for (long long i = 0; i < (long long)(n); i++)
#define INF 999999999
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );

using llong = long long;
using namespace std;

int main(){
    llong n,m;
    cin >> n >> m;
    if(n%2 == 0){
        rep(i,m){
        cout << 1+i << " " << n-i << endl;
        }
    }
    else{
        rep(i,m){
        cout << i+2 << " " << n-i << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:2: error: expected '}' at end of input
   23 | }
      |  ^
a.cc:11:11: note: to match this '{'
   11 | int main(){
      |           ^
Language: C++

#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
int main() {
	ll n, m;
	cin >> n >> m;
	if (m % 2 == 0)
	{
		cout << 1 << ' ' << m * 2 - i + 2 << endl;

		for (ll i = 2; i <= m; i++)
		{
			cout << i << ' ' << m * 2 - i + 1 << endl;
		}
	}
	else
	{
		for (ll i = 1; i <= m; i++)
		{
			cout << i << ' ' << m * 2 - i + 1 << endl;
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:45: error: 'i' was not declared in this scope
    9 |                 cout << 1 << ' ' << m * 2 - i + 2 << endl;
      |                                             ^
Language: C++

#include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<(n); i++)
#define all(x) (x).begin(), (x).end()
#define bit(x) (1L << (x))
using ll = long long;
using namespace std;

template<typename T>
vector<T> make_v(size_t a,T b){return vector<T>(a,b);}
 
template<typename... Ts>
auto make_v(size_t a,Ts... ts){
        return vector<decltype(make_v(ts...))>(a,make_v(ts...));
}

int main() {
        int n, m;
        cin >> n >> m;

        if (n % 2) {
                rep (i, m) {
                        cout << i + 1 << " " << n - i << endl;
                }
        } else {
                bool f = false;
                rep (i, m) {
                        if ((n - i) - (i + 1) - 1== (n - 2) / 2) f = true;
                        cout << i + 1 << " " << n - i - f << endl;
                }
        }


Compiler output:
a.cc: In function 'int main()':
a.cc:30:10: error: expected '}' at end of input
   30 |         }
      |          ^
a.cc:16:12: note: to match this '{'
   16 | int main() {
      |            ^
Language: C++

#include <bits/stdc++.h>
#define rep(i, a, n) for (int i = (int)(a); i <= (int)(n); ++i)
#define rrep(i, a, n) for (int i = (int)(a); i >= (int)(n); --i)
#define debug(x) cerr << #x << " = " << x << "\n"
#define debugv(x) \
  rep(f, 0, (x.size() - 1)) cerr << x[f] << (f == (x.size() - 1) ? "\n" : " ")
#define debug2(x, y)                       \
  cerr << "(" << #x << "," << #y << ") = " \
       << "(" << x << "," << y << ")\n"
#define all(x) x.begin(), x.end()
#define each(a, x) for (auto& a : (x))
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define int long long
#define yn(x) puts((x ? "Yes" : "No"))
using namespace std;
using pii = pair<int, int>;
using vi = vector<int>;
const int MX = 1e5 + 5, INF = 5LL << 57, MOD = 1e9 + 7;

int N, M;
string S;
vi va, vb;

void input() {
  ;
  ;
  cin>>N>>M;
}

void solve() {
  // vector<pii> as;
  // as.push_back(pii(1,2));
  // rep(i,0,M-1){
  //   pii k = as.back();
  //   cout<<k.first<<" "<<k.second<<endl;
  //   as.push_back(pii((k.first+i+1)%N+1,(k.second+i+2)%N+1));
  // }
  ;
  ;
  int j=0;
  set<int> st;
  rep(i,1,N){
    st.insert(i);
  }
  rep(i,1,M){
    if (st.find(j%N+1) == st.end() && st.find((j+1)%N+1) == st.end()){
    cout<<(j)%N+1<<" "<< (j+i)%N+1<<endl;
    st.erase(j%N+1);
    st.erase((j+i)%N+1)
    }
    else {
      j++;
      i--;
    }
  }
}
signed main() {
  cout << setprecision(12);
  input();
  solve();
  return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:50:24: error: expected ';' before '}' token
   50 |     st.erase((j+i)%N+1)
      |                        ^
      |                        ;
   51 |     }
      |     ~
Language: C++

#include <bits/stdc++.h>

#define rep(i,n) for(int i=0; i<(n); i++)
#define reps(i,x,n) for(int i=x; i<(n); i++)
#define rrep(i,n) for(int i=(n)-1; i>=0; i--)
#define all(X) (X).begin(),(X).end()
#define X first
#define Y second
#define pb push_back
#define eb emplace_back

using namespace std;
typedef long long int ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }

template<class A, size_t N, class T> void Fill(A (&a)[N], const T &v){ fill( (T*)a, (T*)(a+N), v ); }

template<class T> ostream& operator<<(ostream &os, const vector<T> &t) {os<<"{"; rep(i,t.size()) {os<<t[i]<<",";} os<<"}"; return os;}
template<class T,size_t n> ostream& operator<<(ostream &os, const array<T,n> &t) {os<<"{"; rep(i,n) {os<<t[i]<<",";} os<<"}"; return os;}
template<class S, class T> ostream& operator<<(ostream &os, const pair<S,T> &t) { return os<<"("<<t.first<<","<<t.second<<")";}

const ll INF = 1e9+7;


int main(){
	ios_base::sync_with_stdio(false);
	int N, M;

	cin >> N >> M;

	if(M == 1){
		cout << 1 << " " << N << endl;
		return;
	}

	rep(i,M) cout << i+1+(i>=M/2) << " " << N-i << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:17: error: return-statement with no value, in function returning 'int' [-fpermissive]
   37 |                 return;
      |                 ^~~~~~
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

#define REP(i, n) for(int i = 0; i < (int)(n); ++i)
#define FOR(i, m, n) for(int i = (int)(m); i < (int)(n); ++i)


int main()
{
    int N, M;
    cin >> N >> M;

    int i = 1, len = 2;
    REP(k, M){
        cout << i << " " << i+j-1 << endl;
        i += len;
        len++;
        
    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:31: error: 'j' was not declared in this scope
   17 |         cout << i << " " << i+j-1 << endl;
      |                               ^
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define all(v) v.begin(), v.end()
using namespace std;
typedef long long ll;

int main() {
	int n, m;
	cin >> n >> m;
	
	// rep(i, m) {
	// 	int a = i+1;
	// 	int b = n-i;
	// 	printf("%d %d\n", a, b);
	// }
	vector<bool> c(n);
	rep(i, m) {
		if(c[i] == true) continue;
		int w = i+1;
		for(int j = i; j < n; j++) {
			int next = (j+w)%n;
			if(c[j] == false && c[next] = false) {
				c[j] = true;
				c[next] = true;
				cout << j+1 << " " << j+1+w << endl;
			}
		}
	}
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:42: error: lvalue required as left operand of assignment
   22 |                         if(c[j] == false && c[next] = false) {
      |                            ~~~~~~~~~~~~~~^~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<ll>;
using vii = vector<vi>;
using Pll = pair<ll, ll>;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(v) v.begin(), v.end()
#define sz(x) ((int) x.size())
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define F first
#define S second
const int MOD = 1000000007;
template<class T> void print(const T& t){ cout << t << endl; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

int main(){
  ll n, m;
  cin >> n >> m;
  ll a = n / 2;
  vi x(m);
  vi y(m);
  for (ll i = a; i >= a - m + 1;i){
    x[i] = i;
  }
  for (i = a + 1; i <= a + m;i++){
    y[i] = i;
  }
  rep(i,m){
    cout << x[i] << " " << y[i] << "\n";
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:8: error: 'i' was not declared in this scope
   29 |   for (i = a + 1; i <= a + m;i++){
      |        ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0; i<n; i++)
const double PI=3.14159265358979323846;
const long long INF = 1LL << 60;

int main() {
	int N, M;
	cin >> N >> M;
	int a=0, b=0, c=0, x, y, z;

	if (N%2 = 1){
		rep(i, M) {
			std::cout << i+1 << 2*M-i << '\n';
		}
	} else {
		rep(i, M) {
			std::cout << (1+3*i)%N << (2+3*i)%N << '\n';
		}
	}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:14: error: lvalue required as left operand of assignment
   12 |         if (N%2 = 1){
      |             ~^~
Language: C++

#include <bits/stdc++.h>
#include <algorithm>
#include <math.h>
#define rep(i, n) for (long long i = 0; i < (long long)(n); i++)
#define INF 999999999
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );

using llong = long long;
using namespace std;

int main(){
    llong n,m;
    cin >> n >> m;
    if(n%2 == 0){
        rep(i,m){
        cout << 1+i << " " << n-i << endl;
    }else{
        rep(i,m){
        cout << 1+i+1 << " " << n-i << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:6: error: expected '}' before 'else'
   17 |     }else{
      |      ^~~~
a.cc:14:17: note: to match this '{'
   14 |     if(n%2 == 0){
      |                 ^
a.cc:21:2: error: expected '}' at end of input
   21 | }
      |  ^
a.cc:11:11: note: to match this '{'
   11 | int main(){
      |           ^
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <utility>
#include <tuple>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <list>
#include <iterator>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <bitset>
#include <numeric>
#include <functional>

using namespace std;

int main() {
	int n, m; cin >> n >> m;
	int cnt = 0;
	for (int i = 1; i < n; ++i) {
		if (cnt == m) break;
		if (gcd(n, i) == 1)) cout << 1 << " " << i + 1 << endl, ++cnt;
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:36: error: expected primary-expression before ')' token
   27 |                 if (gcd(n, i) == 1)) cout << 1 << " " << i + 1 << endl, ++cnt;
      |                                    ^
Language: C++

#include <iostream>
#include <vector>
#include <string>
#include <queue>
#include <stack>
#include <unordered_set>
#include <unordered_map>
#include <cmath>

using namespace std;

int main()
{
    int n, m;
    cin >> n >> m;
    if (n % 2 != 0)
    {
        int s = 1, t = 2 * m;
        for (int i = 0; i < m; i++)
        {
            cout << s << " " << t << endl;
            s++;
            t--;
        }
    }
    else
    {
        if(m==1){
            cout<<1<<" "<<2*m<<endl;
            continue;
        }else{
            cout<<1<<" "<<2*m<<endl;
            cout<<2<<" "<<2*m-1<<endl;
            continue;
        }
        int s=3, t=2*m-4;
        cout<<2*m-2<<" "<<2*m<<endl;
        cout<<2<<" "<<2*m-1<<endl;
        cout<<1<<" "<<2*m-3<<endl;
        for(int i=0;i<m-3;i++){
            cout<<s<<" "<<t<<endl;
            s++; t--;        
        }
    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:13: error: continue statement not within a loop
   30 |             continue;
      |             ^~~~~~~~
a.cc:34:13: error: continue statement not within a loop
   34 |             continue;
      |             ^~~~~~~~
Language: C

#include<iostream>
#include<stdio.h>
#include<math.h>
using namespace std;
int gcd(int a,int b) {
    int r;
    while(b>0) {
        r=a%b;
        a=b;
        b=r;
    }
    return a;
}
int main ( )
{
    int m,n,j;
    scanf("%d %d",&n,&m);
    printf("1 %d\n",n-1);
    m--;
    int i=2;
    for(j=2;m&&(j<n/2+1);j++)
        {
            int k=gcd(n,j);
            if(j*k>=n)
            {
                printf("%d %d\n",i,i+j);
                i++;
                m--;
            }
        }
    return 0;
}




Compiler output:
main.c:1:9: fatal error: iostream: No such file or directory
    1 | #include<iostream>
      |         ^~~~~~~~~~
compilation terminated.
Language: C++

#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<vector>
#include<map>
#include<set>
#include<string>
#include<queue>
#include<stack>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
#define INF ((1<<30)-1)
#define LINF (1LL<<60)
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
typedef long long ll;
typedef pair<int,int> P;

int main(){
    int n,m;
    cin >> n >> m;
    if(n%2==1){
    int l = m;
    int r = m+1;
    rep(i,m){
        cout << l << ' ' << r << endl;
        l--;
        r++;
    }
    }else{
        int l = m;
        int t = m+1;
        rep(i,m){
            cout << l << ' ' << r << endl;
            l--;
            r+=i+1;
        }
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:33: error: 'r' was not declared in this scope
   35 |             cout << l << ' ' << r << endl;
      |                                 ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<ll>;
using vii = vector<vi>;
using Pll = pair<ll, ll>;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(v) v.begin(), v.end()
#define sz(x) ((int) x.size())
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define F first
#define S second
const int MOD = 1000000007;
template<class T> void print(const T& t){ cout << t << endl; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

int main(){
  ll n, m;
  cin >> n >> m;
  ll a = n / 2;
  vi x(m);
  vi y(m);
  for (ll i = a; i >= a - m + 1;i){
    x[i] = i;
  }
  for (i = a + 1; i <= a + m;i++){
    y[i] = i;
  }
  rep(i,m){
    cout<<x[i]<<" "<<y[i]<<"\n"
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:8: error: 'i' was not declared in this scope
   29 |   for (i = a + 1; i <= a + m;i++){
      |        ^
a.cc:33:32: error: expected ';' before '}' token
   33 |     cout<<x[i]<<" "<<y[i]<<"\n"
      |                                ^
      |                                ;
   34 |   }
      |   ~
Language: C++

//is there any case of -1 or any special corner cases ?
#include<bits/stdc++.h>
using namespace std;
#define int long long int 
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define vi vector<int>
#define pi pair<int,int>
#define all(v) v.begin(),v.end()
#define zeros(arr) memset(arr,0,sizeof(arr));
#define precise(num)  cout<<fixed; cout << std::setprecision(num)
#define nl cout<<"\n";
#define test int t;cin>>t;while(t--) 
const int maxx  = 3*1e5 , limit = 1e17 , MOD=1e9+7;


#define boost  ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
int ans =0 ;
vector < pair < pair < int ,int > , pair < int, int >  >  >  v;
vector < pair < pair < int ,int > , pair < int, int >  >  > V;

int n;
stack<int>st;
void calculate(vector<int>v1){
    
    int val =0 ;
    for(int i=0;i<v.size() ;i++){
        int i1=v[i].se.se;
        int i2=v[i].se.fi;
        if(v1[i1-1]-v1[i2-1] == v[i].fi.se)val+=v[i].fi.fi;
    }
    ans = max(ans,val);
    
    return ;
    
    
    
}
void dfs(int len , int m){
    
    if(len == n){
        vector<int>v1;
        while(st.size()){
            int p =st.top();
            v1.pb(p);
            st.pop();
        }
        for(int i = v1.size()-1 ; i>=0 ; i-- )
            st.push(v1[i]);
            
        calculate(v1);    
        
        
            
        
        return ;    
    }
    
        for(int i=1; i<= m ;i ++ ){
                
                st.push(i);
                dfs(len+1,m);
                st.pop();
        }
    
    
    
}
        
string binary(int n, int k){
    string q="";
    int cp=0;
    while(n){
        if(n%2)q+='1';
        else q+='0';
        
        cp+=n%2;
        n/=2;
        
    }
    
    if(cp == k)
        return q;
    else{
        q="NA";
        return q;
    }
}

int32_t main(){
    int n,m;
    cin>>n>>m;
    int c=0;
        for(int i=m;i>=1;i--){
        cout<<1<<" "<<1+k+c<<endl;
        
            c++;
        }
 
}

Compiler output:
a.cc: In function 'int32_t main()':
a.cc:97:25: error: 'k' was not declared in this scope
   97 |         cout<<1<<" "<<1+k+c<<endl;
      |                         ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define ALL(A) A.begin(),A.end()
#define RALL(A) A.rbegin(),A.rend()
typedef long long ll;
typedef pair<ll,ll> P;
const ll mod=1000000007;
const ll LINF=1LL<<60;
const ll INF=1<<30;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

int main(){
	ll m,n;cin>>n>>m;
	ll b = n - 2 * m;
	vector<ll> a(n - (n - 2 * m),);
	ll x = 0;
	for(ll i = 0; i < n - ( n - 2 * m); i++) {
		if(b > 0){
			b--;
			x+= 2;
			a[i] = x;
		}
		else{
			x++;
			a[i] = x;
		}

	}
	for(ll i = 0; i < m; i++) {
		cout << a[i]- 1 << ' ' << a[2 * m - i - 1] - 1 << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:38: error: expected primary-expression before ')' token
   21 |         vector<ll> a(n - (n - 2 * m),);
      |                                      ^
Language: C++

#include<iostream>
#include<cmath>
using namespace std;

int main() {
	long long n, m, range;
	cin >> n >> m;
	range = n / 2;
	range *= 2;
	range--;
	for (long long i = 0; i < m; i++) {
		cout << i + 1 << " " << i + long long(1) + range << '\n';
		range -= 2;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:45: error: expected primary-expression before 'long'
   12 |                 cout << i + 1 << " " << i + long long(1) + range << '\n';
      |                                             ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;

#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=(ll)(n)-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=(a);i<=(b);i++)
#define FORD(i,a,b) for(ll i=(a);i>=(b);i--)
#define ALL(x) (x).begin(),(x).end() //sortなどの引数を省略したい
#define SIZE(x) ((ll)(x).size()) //sizeをsize_tからllに直しておく
#define MAX(x) *max_element(ALL(x))
#define INF 1000000000000 //10^12
#define MOD 1000000007 //10^9+7
#define PB push_back
#define MP make_pair
#define F first
#define S second
#define MAXR 100000 //10^5:最大のrange(素数列挙などで使用)
#define Sp(p) cout<<setprecision(25)<< fixed<<p<<endl //　少数の精度を高くする出力

int main(){
    ll N,M;
    cin >> N >> M;
    if (N%2==1) {
        FOR(i,0,M-1) {
            cout << N/2-i << ' ' << N/2+1+i << endl;
        }
    }
    else {
        FOR(i,0,M-2) {
            }
            cout << N/2-i << ' ' << N/2+i+1 << endl;
        }
        cout << N/2-(M-1)-1 << ' ' << N/2+(M-1)+1 << endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:33:25: error: 'i' was not declared in this scope
   33 |             cout << N/2-i << ' ' << N/2+i+1 << endl;
      |                         ^
a.cc: At global scope:
a.cc:37:1: error: expected declaration before '}' token
   37 | }
      | ^
Language: C++

# include <bits/stdc++.h>
# define rep(i, n) for(int i=0, i##_len=(n); i<i##_len; ++i)
# define reps(i, n) for(int i=1, i##_len=(n); i<=i##_len; ++i)
# define rrep(i, n) for(int i=((int)(n)-1); i>=0; --i)
# define rreps(i, n) for(int i=((int)(n)); i>0; --i)
# define ALL(x) (x).begin(), (x).end()
# define SZ(x) ((int)(x).size())
# define pb push_back
# define optimize_cin() cin.tie(0); ios::sync_with_stdio(false)
using namespace std;
using ll = long long;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
const long long INF = 1LL << 60;

ll gcd(ll a, ll b)
{
   if (a%b == 0)
   {
       return(b);
   }
   else
   {
       return(gcd(b, a%b));
   }
}

uintmax_t combination(unsigned int n, unsigned int r) {
  if ( r * 2 > n ) r = n - r;
  uintmax_t dividend = 1;
  uintmax_t divisor  = 1;
  for ( unsigned int i = 1; i <= r; ++i ) {
    dividend *= (n-i+1);
    divisor  *= i;
  }
  return dividend / divisor;
}

int modPow(long long a, long long n, long long p) {
  if (n == 1) return a % p;
  if (n % 2 == 1) return (a * modPow(a, n - 1, p)) % p;
  long long t = modPow(a, n / 2, p);
  return (t * t) % p;
}

ll lcm(ll a, ll b)
{
   return a / gcd(a, b) * b;
}

int main()
{
  ll n,m;
  cin >> n >> m;
  vector<pair<ll,ll>> ans(m);

  if(n % 2 == 0){
      rep(i,m){
          ans[i].first = i + 1;
          else ans[i].second = n - i;
      }
  }
  else{
      rep(i,m){
          ans[i].first = i + 1;
          ans[i].second = n - i;
      }
  }

  rep(i,m) cout << ans[i].first << " " << ans[i].second << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:60:11: error: 'else' without a previous 'if'
   60 |           else ans[i].second = n - i;
      |           ^~~~
Language: C++

#include <iostream>

using namespace std;


int main() {
  int n, m, l;
  cin >> n >> m;
  int k = n / 2;
  int a = n % 2;
  if (a == 0) {
    k = 1;
    for (int i = 0; i < m, i++) {
      if (k > n) k % n;
      l = k + i + 1;
      if (l > n) l % n;
      cout << k << " " << l << endl;
      k = l + 1;
    }
  } else {
    for (int i = 0; i < m; i++) {
    cout << k - i << " " <<  k + i + 1 << endl;
    }
  }

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:31: error: expected ';' before ')' token
   13 |     for (int i = 0; i < m, i++) {
      |                               ^
      |                               ;
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
  int N, M; cin >> N >> M;
  int k=2*M+1;
  if(N%2==0 && N%4!=0 && N-(2*M)==(N/2)-1){
    for(int i=1;i<=M;i++){
      if(i==1){
        cout << i << " " << N << endl;
      }
      if(i==2){
        cout << i+((N/2-1)/2)-1 << " " << N-((N/2-1)/2)-2 << endl;
      }
      if(i!=1 && i!=2) cout << i+((N/2-1)/2)-1 << " " << k-i+((N/2-1)/2)-1 << endl;
    }
    return 0;
  }
  for(int i=1;i<=M;i++){
    cout << i << " " << k-i << endl;
  }
  return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:22:12: error: expected '}' at end of input
   22 |   return 0;
      |            ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

//omajinai c++ atcoder
#include <iostream> 
#include <string> 
#include <vector> 
#include <algorithm> 
#include <utility> 
#include <tuple> 
#include <cstdint> 
#include <cstdio> 
#include <map> 
#include <queue> 
#include <set> 
#include <stack> 
#include <deque> 
#include <unordered_map> 
#include <unordered_set> 
#include <bitset> 
#include <cctype> 
#include<cmath>
#include<iomanip>
#include<type_traits>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define itn int
#define yes() printf("Yes\n")
#define no() printf("No\n")
typedef long long ll;
constexpr auto mod = 1000000007;
using namespace std;

int main() {
  int n,m;
  cin>>n>>m;
  rep(i,m){
    cout<<i+1<' '<<2*m-i<<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:25: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
   35 |     cout<<i+1<' '<<2*m-i<<endl;
      |               ~~~~~~~~~~^~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main(){
  int n,m;
  cin>>n>>m;
  int k = n/2;
  int l = k+1;
  if (n%2!=0){for(int i=0; i<m; i++){
    cout<<k<<' '<< l<<endl;
      k--;
    l++;}}
  else if(n%3!=0){for(int i=0; i<m; i++){
    cout<<k<<' '<< l<<endl;
      k-=2;
    l+=2;
  if (k<0) k+=n;
  if (l>n) l-=n}}
  else if(n%5!=0){for(int i=0; i<m; i++){
    cout<<k<<' '<< l<<endl;
      k-=4;
    l+=4;
  if (k<0) k+=n;
  if (l>n) l-=n}}
  else if(n%7!=0){for(int i=0; i<m; i++){
    cout<<k<<' '<< l<<endl;
      k-=6;
    l+=6;
  if (k<0) k+=n;
  if (l>n) l-=n}}
  else if(n%11!=0){for(int i=0; i<m; i++){
    cout<<k<<' '<< l<<endl;
      k-=10;
    l+10;
  if (k<0) k+=n;
  if (l>n) l-=n}}
  else if(n%13!=0){for(int i=0; i<m; i++){
    cout<<k<<' '<< l<<endl;
      k-=12;
    l+=12;
  if (k<0) k+=n;
  if (l>n) l-=n}}
  else if(n%17!=0){for(int i=0; i<m; i++){
    cout<<k<<' '<< l<<endl;
      k-=16;
    l+=16;
  if (k<0) k+=n;
  if (l>n) l-=n}}
  else if(n%19!=0){for(int i=0; i<m; i++){
    cout<<k<<' '<< l<<endl;
      k-=18;
    l+=18;
  if (k<0) k+=n;
  if (l>n) l-=n}}
  else if(n%13!=0){for(int i=0; i<m; i++){
    cout<<k<<' '<< l<<endl;
      k-=22;
    l+=22;
  if (k<0) k+=n;
  if (l>n) l-=n}}
  else if(n%209!=0){for(int i=0; i<m; i++){
    cout<<k<<' '<< l<<endl;
      k-=208;
    l+=208;
  if (k<0) k+=n;
  if (l>n) l-=n}}
      
  
 
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:16: error: expected ';' before '}' token
   18 |   if (l>n) l-=n}}
      |                ^
      |                ;
a.cc:24:16: error: expected ';' before '}' token
   24 |   if (l>n) l-=n}}
      |                ^
      |                ;
a.cc:30:16: error: expected ';' before '}' token
   30 |   if (l>n) l-=n}}
      |                ^
      |                ;
a.cc:36:16: error: expected ';' before '}' token
   36 |   if (l>n) l-=n}}
      |                ^
      |                ;
a.cc:42:16: error: expected ';' before '}' token
   42 |   if (l>n) l-=n}}
      |                ^
      |                ;
a.cc:48:16: error: expected ';' before '}' token
   48 |   if (l>n) l-=n}}
      |                ^
      |                ;
a.cc:54:16: error: expected ';' before '}' token
   54 |   if (l>n) l-=n}}
      |                ^
      |                ;
a.cc:60:16: error: expected ';' before '}' token
   60 |   if (l>n) l-=n}}
      |                ^
      |                ;
a.cc:66:16: error: expected ';' before '}' token
   66 |   if (l>n) l-=n}}
      |                ^
      |                ;
Language: C++

#include <bits/stdc++.h>
using namespace std;

#define SZ(v) ((int)(v).size())
using ll = long long;

int main(void)
{
	ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

	int N, M;
	cin >> N >> M;
	int l(1), r(N - (1-N%2))
	for (int i(0); i < M; ++i)
		cout << l++ << ' ' << r-- << '\n';
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:9: error: expected ',' or ';' before 'for'
   14 |         for (int i(0); i < M; ++i)
      |         ^~~
a.cc:14:24: error: 'i' was not declared in this scope
   14 |         for (int i(0); i < M; ++i)
      |                        ^
Language: C++

#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<ll ,ll> pll;
#define F first
#define S second
#define pb push_back
#define mp make_pair
#define all(X) (X).begin(), (X).end()
#define sll(n) scanf("%lld",&n)
#define sll2(x,y) scanf("%lld%lld",&x,&y)
#define sll3(x,y,z) scanf("%lld%lld%lld",&x,&y,&z)
#define REP(i,x,y) for(ll i = x;i <= y;++i)
vector<string> vec_splitter(string s) {
    for(char& c: s) c = c == ','?  ' ': c;
    stringstream ss; ss << s;
    vector<string> res;
    for(string z; ss >> z; res.push_back(z))
        ;
    return res;
}
void debug_out(vector<string> args, int idx) { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(vector<string> args, int idx, Head H, Tail... T) {
    if(idx > 0) cerr << ", ";
    stringstream ss; ss << H;
    cerr << args[idx] << " = " << ss.str();
    debug_out(args, idx + 1, T...);
}
#define debug(...) debug_out(vec_splitter(#__VA_ARGS__), 0, __VA_ARGS__)
void localTest() {
    #ifndef ONLINE_JUDGE
        freopen("inp", "r", stdin);
        freopen("out", "w", stdout);
    #endif      
}
int main() {

    localTest();
    srand(time(NULL));
    ll n, m;
    sll2(n, m);
    vector<int> A, B;
    REP(i, 1, m) {
        ll nn = 2 * m + 1;
        A.pb(i);
        B.pb(n - i + 1);
        // printf("%lld %lld\n", i, nn - i + 1);
    }   
    // random_shuffle(all(B));
    reverse(all(B))
    REP(i, 0, m - 1) printf("%d %d\n",A[i], B[i]);
    

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:51:20: error: expected ';' before 'for'
   51 |     reverse(all(B))
      |                    ^
      |                    ;
a.cc:52:9: error: 'i' was not declared in this scope
   52 |     REP(i, 0, m - 1) printf("%d %d\n",A[i], B[i]);
      |         ^
a.cc:13:33: note: in definition of macro 'REP'
   13 | #define REP(i,x,y) for(ll i = x;i <= y;++i)
      |                                 ^
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<(int)(n); i++)

using namespace std;
typedef long long LL;
typedef pair<int,int> P;

int main(){
	int N, M;
	cin >> N >> M;
	if(N%2==1){
		rep(i,M) cout << i+1 << " " N-1-i << endl;
	}
	else{
		bool used[100010]={0};
		int num=1, i=1;
		while(num!=N/2){
			if(used[i]){
				i++;
				continue;
			}
			cout << i << " " << i+num << endl;
			num++;
		}
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:44: error: expected ';' before 'N'
   12 |                 rep(i,M) cout << i+1 << " " N-1-i << endl;
      |                                            ^~
      |                                            ;
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define mod 1000000007
//ll a[100001]={0};
int main()
{//ios_base::sync_with_stdio(false);
ll n,m;
cin>>n>>m;ll a[m],b[m];
for(int i=0;i<m;i++)
    {a[i]=i+1;b[i]=n-i;
    //cout<<a[i]<<" "<<b[i]<<endl;}
for(int i=m-1;i>=0;i--)
{
    cout<<a[i]<< " "<<b[i]<<endl;
}


}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:2: error: expected '}' at end of input
   19 | }
      |  ^
a.cc:7:1: note: to match this '{'
    7 | {//ios_base::sync_with_stdio(false);
      | ^
Language: C++

#include<iostream>
#include<cmath>
using namespace std;

int main() {
	long long n, m, range;
	cin >> n >> m;
	range = n - 1;
	for (long long i = 0; i < m; i++) {
		cout << i + 1 << " " << i + long long(1) + range << '\n';
		range -= 2;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:45: error: expected primary-expression before 'long'
   10 |                 cout << i + 1 << " " << i + long long(1) + range << '\n';
      |                                             ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;



  
int main(){
  

  int n,m;
  cin>>n>>m;
  
  for (int i=0,i<m;i++){
    cout<<1<<2+i<<endl;
  }
  
  
  
  
}

    












Compiler output:
a.cc: In function 'int main()':
a.cc:13:17: error: expected ';' before '<' token
   13 |   for (int i=0,i<m;i++){
      |                 ^
      |                 ;
a.cc:13:17: error: expected primary-expression before '<' token