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

#include <bits/stdc++.h>

#define ll long long
#define REP(i, x, y) for(ll i = (ll)x; i < (ll)y; i++)

ll a[55], b[55], c[55], d[55];
ll N, M, Q;
ll nums[11];
ll ans = 0;
void solve(ll dep, ll now) {
    if (dep < N) {
        REP(i, now, M + 1) {
            nums[dep] = i;
            solve(dep + 1, i);
        }
    } else {
        ll tmp = 0;
        REP(i, 0, Q) {
            if (nums[b[i]] - nums[a[i]] == c[i]) {
                tmp += d[i];
            }
        }
        ans = max(ans, tmp);
    }
}
 
int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> N >> M >> Q;
    REP(i, 0, Q) {
        cin >> a[i] >> b[i] >> c[i] >> d[i];
        a[i]--;
        b[i]--;
    }
    solve(0, 1);
    cout << ans << '\n';
}

Compiler output:
a.cc: In function 'void solve(long long int, long long int)':
a.cc:23:15: error: 'max' was not declared in this scope; did you mean 'std::max'?
   23 |         ans = max(ans, tmp);
      |               ^~~
      |               std::max
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: 'std::max' declared here
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
a.cc: In function 'int main()':
a.cc:28:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   28 |     cin.tie(0);
      |     ^~~
      |     std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:29:5: error: 'ios' has not been declared
   29 |     ios::sync_with_stdio(false);
      |     ^~~
a.cc:37:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   37 |     cout << ans << '\n';
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

//ヘッダー
#include<bits/stdc++.h>
using namespace std;

//型定義
typedef long long ll;

//定数
const int INF=1e+9;
const int MOD=1e+9+7;

//REPマクロ
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define REP2(i,a,b) for(ll i=a;i<(ll)(b);i++)
#define REPD2(i,a,b) for(ll i=a;i>(ll)(b);i--)

//vectorの扱い
#define ALL(x) (x).begin(),(x).end() //sortなどの引数省略
#define SIZE(x) ((ll)(x).size()) //size
#define MAX(x) *max_element(ALL(x)) //最大値
#define MIN(x) *min_element(ALL(x)) //最小値

//グローバル変数


//ライブラリ挿入


int main(){
    int N,M;
    cin >> N >> M;
    vector<int> a(N),b(N,N);

    int cnt=1;
    REPD(i,1,(N-1)/2+1){
        a[i-1]=i;
        b[i-1]=N+1-i;
        cnt++;
    }
    REP(i,M){
        cout << a[i] << " " << b[i] << endl;
    }
    
    
}

Compiler output:
a.cc:36:23: error: macro "REPD" passed 3 arguments, but takes just 2
   36 |     REPD(i,1,(N-1)/2+1){
      |                       ^
a.cc:14:9: note: macro "REPD" defined here
   14 | #define REPD(i,n) for(ll i=n-1;i>=0;i--)
      |         ^~~~
a.cc: In function 'int main()':
a.cc:36:5: error: 'REPD' was not declared in this scope
   36 |     REPD(i,1,(N-1)/2+1){
      |     ^~~~
Language: C++

#include "bits/stdc++";
using namespace std;

int main(){
  int n,m;
  cin >> n >> m;
  int l=1, r=l+m;
  while(l < r){
    printf("%d %d", l,r);
    l++;r--;
  }
  return 0;
}

Compiler output:
a.cc:1:23: warning: extra tokens at end of #include directive
    1 | #include "bits/stdc++";
      |                       ^
a.cc:1:10: fatal error: bits/stdc++: No such file or directory
    1 | #include "bits/stdc++";
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define P pair<int,int>
using ll=int64_t;
using namespace std;
#define ketasuu(n) fixed<<setprecision(n)
#define btoe(p) p.begin(),p.end()
#define etob(p) p.rbegin(),p.rend()




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


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

//--------------------------------------------------
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,abm,mmx,avx,avx2,popcnt,fma")
#pragma GCC optimize("fast-math")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("Ofast")
//--------------------------------------------------
#include <bits/stdc++.h>
#include <chrono>
#include <set>
#include <map>
#include <deque>
#include <cmath>
#include <queue>
#include <cassert>
#include <random>
#include <bitset>
#include <iomanip>
#include <numeric>
#include <time.h>
#include <ctime>
#include <string>
#include <cstdio>
#include <vector>
#include <cstdlib>
#include <iostream>
#include <algorithm>
#include <unordered_map>
#include <unordered_set>
#include <fstream>
#include <stack>
#include <cstring>
//--------------------------------------------------
#define forn(i, n) for(int i = 0; i < n; i++)
#define forw(i, n) for(int i = n-1; i >= 0; --i)
#define forns(i, n, s) for(int i = s; i < n; i++)
#define x first
#define y second
#define pb push_back
#define mp make_pair
#define all(v) v.begin(),v.end()
#define allr(v) v.rbegin(),v.rend()
//----------------------------------------------------
using namespace std;
//----------------------------------------------------
typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int uint;
typedef long double ld;
typedef vector<ll> lnum;
typedef complex<ld> comp;
//----------------------------------------------------
const ll mod = 1e9 + 7, mod2 = 998244353;
const ld eps = 1e-6;
const ll inf = 1e18;
const int base = 1e9;
const ld PI = 3.1415926;
//----------------------------------------------------
#define endl '\n';
#ifdef MY_DEBUG
void deb(ld x) { cerr << x << endl; };
#else
void deb(ld x){};
#endif
//----------------------------------------------------
int n, m;
//----------------------------------------------------
unsigned int bitcount(ull val) { return __builtin_popcount(val) + __builtin_popcount(val >> 32); }

void local() {
    freopen("test.in", "r", stdin);
}

void remote() {
}

void read() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    cin >> n >> m;
}

int main() {
#ifdef MY_DEBUG
    local();
#else
    remote();
#endif
    read();

    forn(i, m){
        cout << (i*2)+1 << " " << i*2+1 << endl;
    }

}


Compiler output:
main.c:7:10: fatal error: bits/stdc++.h: No such file or directory
    7 | #include <bits/stdc++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

int main(){

  int N,M;
  cin >> N >> M;

  int start1;
  int start2;


  //偶数の時
  if(N%2==0){
    start1 = 1;
    start2 = N-1;
    bool flag = 0;
    for(int i=1;i<=M;i++){
      if(flag==0 && start2-start1>=N/2){
        start1++;
        flag = 1;
      }
      cout << start1 << " " << start2 << endl;
      start1++;
      start2--;
    }
  }else{
    start1 = 1;
    start2 = N-1;
    for(int i=1;i<=M;i++){
      cout << start1 << " " << start2 << endl;
      start1++;
      start2--;
    }
  }

}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:3: error: 'cin' was not declared in this scope
    4 |   cin >> N >> M;
      |   ^~~
a.cc:20:7: error: 'cout' was not declared in this scope
   20 |       cout << start1 << " " << start2 << endl;
      |       ^~~~
a.cc:20:42: error: 'endl' was not declared in this scope
   20 |       cout << start1 << " " << start2 << endl;
      |                                          ^~~~
a.cc:28:7: error: 'cout' was not declared in this scope
   28 |       cout << start1 << " " << start2 << endl;
      |       ^~~~
a.cc:28:42: error: 'endl' was not declared in this scope
   28 |       cout << start1 << " " << start2 << endl;
      |                                          ^~~~
Language: C++

int main(){

  int N,M;
  cin >> N >> M;

  int start1;
  int start2;


  //偶数の時
  if(N%2==0){
    start1 = 1;
    start2 = N-1;
    bool flag = 0;
    for(int i=1;i<=M;i++){
      if(flag==0start2-start1>=N/2){
        start1++;
        flag = 1;
      }
      cout << start1 << " " << start2 << endl;
      start1++;
      start2--;
    }
  }else{
    start1 = 1;
    start2 = N-1;
    for(int i=1;i<=M;i++){
      cout << start1 << " " << start2 << endl;
      start1++;
      start2--;
    }
  }

}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:3: error: 'cin' was not declared in this scope
    4 |   cin >> N >> M;
      |   ^~~
a.cc:16:16: error: unable to find numeric literal operator 'operator""start2'
   16 |       if(flag==0start2-start1>=N/2){
      |                ^~~~~~~
a.cc:20:7: error: 'cout' was not declared in this scope
   20 |       cout << start1 << " " << start2 << endl;
      |       ^~~~
a.cc:20:42: error: 'endl' was not declared in this scope
   20 |       cout << start1 << " " << start2 << endl;
      |                                          ^~~~
a.cc:28:7: error: 'cout' was not declared in this scope
   28 |       cout << start1 << " " << start2 << endl;
      |       ^~~~
a.cc:28:42: error: 'endl' was not declared in this scope
   28 |       cout << start1 << " " << start2 << endl;
      |                                          ^~~~
Language: Java

import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc =new Scanner(System.in);
    int N =sc.nextInt();
    int M =sc.nextInt();
    if(N%2==1){
    for(int i=1;i<=M;i++){
      int C =N-i+1;
      System.out.println(i+" "+C);}}
    else{
      int n=N%2;
      int k=n%2
        for(int j=1;j<=k;j++){
          int D =n+1-j;
          System.out.println(j+" "+D);}
    }
  }
}



Compiler output:
Main.java:13: error: ';' expected
      int k=n%2
               ^
1 error
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long
int n,m; 
int main()
{
   scanf("%d %d",&n,&m);
   if(n%2==0)n--;
   int l=1;r=n/2+2;
   int t=n/2;
   for(int i = 1; i <= m; i++) {
		for(int i = 1; i <= m; i++) {
		if(i & 1) {
			printf("%d %d\n", l, l + t);
			t--;
			l++;
		}
		else {
			printf("%d %d\n", r, r + t);
			t--;
			r++;
		}
	}
	

return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:12: error: 'r' was not declared in this scope
    9 |    int l=1;r=n/2+2;
      |            ^
a.cc:27:2: error: expected '}' at end of input
   27 | }
      |  ^
a.cc:6:1: note: to match this '{'
    6 | {
      | ^
Language: C++

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

int main(){

  int N,M;
  cin >> N >> M;


  for(int i=;i<=M*2;i++){
    cout << i << " " << M*2-i << endl;
  }

}

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

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MOD = 1e9 + 7;
const ll INF = 1LL << 60;
ll mod_pow(ll, ll, ll);
ll mod_fact(ll, ll);
ll mod_inv(ll, ll);
//
int main(){
    int n, m;
    cin >> n >> m;
    if(n % 2){
        for(int i = 1; i <= m; i++){
            cout << i << " " << n + 1 - i << "\n";
        }
    }else{
        for(int i = 1; i <= m / 2){
            cout << i << " " << n + 1 - i << "\n";
        }for(int i = m / 2 + 1; i <= m; i++){
            cout << m / 2 - i << " " << m / 2 + 1 << "\n";
        }
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:34: error: expected ';' before ')' token
   18 |         for(int i = 1; i <= m / 2){
      |                                  ^
      |                                  ;
Language: C++

#include <iostream>

using namespace std;


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


Compiler output:
a.cc:40:3: error: expected unqualified-id before 'return'
   40 |   return 0;
      |   ^~~~~~
a.cc:41:1: error: expected declaration before '}' token
   41 | }
      | ^
Language: C++

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

typedef ll long long;

ll n, k, low, up;
 
int main(){
	cin >> n >> k;
	low = k - k / 2;
	up = k / 2;
	for(ll i = 1; i <= low; i++){
		cout << i << " " << low * 2 - i + 1 << '\n';
	}
	for(ll i = 1; i <= up; i++){
		cout << low * 2 + i << " " << low * 2 + up * 2 - i + 2 << '\n';
	}
}

Compiler output:
a.cc:4:9: error: 'll' does not name a type
    4 | typedef ll long long;
      |         ^~
a.cc:6:1: error: 'll' does not name a type
    6 | ll n, k, low, up;
      | ^~
a.cc: In function 'int main()':
a.cc:9:16: error: 'n' was not declared in this scope; did you mean 'yn'?
    9 |         cin >> n >> k;
      |                ^
      |                yn
a.cc:9:21: error: 'k' was not declared in this scope
    9 |         cin >> n >> k;
      |                     ^
a.cc:10:9: error: 'low' was not declared in this scope; did you mean 'pow'?
   10 |         low = k - k / 2;
      |         ^~~
      |         pow
a.cc:11:9: error: 'up' was not declared in this scope; did you mean 'dup'?
   11 |         up = k / 2;
      |         ^~
      |         dup
a.cc:12:13: error: 'll' was not declared in this scope
   12 |         for(ll i = 1; i <= low; i++){
      |             ^~
a.cc:12:23: error: 'i' was not declared in this scope
   12 |         for(ll i = 1; i <= low; i++){
      |                       ^
a.cc:15:13: error: 'll' was not declared in this scope
   15 |         for(ll i = 1; i <= up; i++){
      |             ^~
a.cc:15:23: error: 'i' was not declared in this scope
   15 |         for(ll i = 1; i <= up; i++){
      |                       ^
Language: C++

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

using long long ll;

ll n, k, low, up;
 
int main(){
	cin >> n >> k;
	low = k - k / 2;
	up = k / 2;
	for(ll i = 1; i <= low; i++){
		cout << i << " " << low * 2 - i + 1 << '\n';
	}
	for(ll i = 1; i <= up; i++){
		cout << low * 2 + i << " " << low * 2 + up * 2 - i + 2 << '\n';
	}
}

Compiler output:
a.cc:4:7: error: expected nested-name-specifier before 'long'
    4 | using long long ll;
      |       ^~~~
a.cc:6:1: error: 'll' does not name a type
    6 | ll n, k, low, up;
      | ^~
a.cc: In function 'int main()':
a.cc:9:16: error: 'n' was not declared in this scope; did you mean 'yn'?
    9 |         cin >> n >> k;
      |                ^
      |                yn
a.cc:9:21: error: 'k' was not declared in this scope
    9 |         cin >> n >> k;
      |                     ^
a.cc:10:9: error: 'low' was not declared in this scope; did you mean 'pow'?
   10 |         low = k - k / 2;
      |         ^~~
      |         pow
a.cc:11:9: error: 'up' was not declared in this scope; did you mean 'dup'?
   11 |         up = k / 2;
      |         ^~
      |         dup
a.cc:12:13: error: 'll' was not declared in this scope
   12 |         for(ll i = 1; i <= low; i++){
      |             ^~
a.cc:12:23: error: 'i' was not declared in this scope
   12 |         for(ll i = 1; i <= low; i++){
      |                       ^
a.cc:15:13: error: 'll' was not declared in this scope
   15 |         for(ll i = 1; i <= up; i++){
      |             ^~
a.cc:15:23: error: 'i' was not declared in this scope
   15 |         for(ll i = 1; i <= up; i++){
      |                       ^
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:6:11: error: expected primary-expression before '=' token
    6 |   if(M%2===0){
      |           ^
Language: C

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define P pair<int,int>
using ll=int64_t;
using namespace std;
#define ketasuu(n) fixed<<setprecision(n)
#define btoe(p) p.begin(),p.end()
#define etob(p) p.rbegin(),p.rend()




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


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

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


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

#include <iostream>
#include <bits/stdc++.h>
using namespace std;
int n,m;
int main()
{
    cin >>n>>m;

    for(int i=1;i<=m;i++){
    cout<<i<<" "<<n+1-i;
    }

}


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

#include <bits/stdc++.h>
using namespace std;
#define rep(i,N) for(int i=0;i<int(N);++i)
#define rep1(i,N) for(int i=1;i<int(N);++i)
#define all(a) (a).begin(),(a).end()
#define print(v) { cerr<<#v<<": [ "; for(auto _ : v) cerr<<_<<", "; cerr<<"]"<<endl; }
#define printpair(v) { cerr<<#v<<": [ "; for(auto _ : v) cerr<<"{"<<_.first<<","<<_.second<<"}"<<", "; cerr<<"]"<<endl; }
#define dump(x) cerr<<#x<<": "<<x<<endl;
#define bit(k) (1LL<<(k))
typedef long long ll;
typedef pair<int, int> i_i;
typedef pair<ll, ll> l_l;
template <class T> using vec = vector<T>;
template <class T> using vvec = vector<vec<T>>;
template< typename T1, typename T2 >
ostream &operator<<(ostream &os, const pair< T1, T2 >& p) {
  os << "{" <<p.first << ", " << p.second << "}";
  return os;
}
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

const int INF = (ll)1e9;
const ll INFLL = (ll)1e18+1;
const ll MOD = (ll)1e9+7;
const double PI = acos(-1.0);
/*
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
const string dir = "DRUL";
*/

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

    int N, M;
    cin >> N >> M;
    vector<i_i> ans;
    //奇数は単純
    if(N&1){
        for(int l = 1, r = N-1;l < r;l++,r--){
            ans.emplace_back(l, r);
        }
    }
    //偶数は途中で変えないといけない
    else{
        bool f = false;
        for(int l = 1,r = N-1; l < r; l++, r--){
            ans.emplace_back(l,r);
            if(!f&&r-l<=N/2)
                f = true;
                r--;
            }
        }
    }
    rep(i,M){
        cout << ans[i].first << " " << ans[i].second << endl;
    }
}

Compiler output:
a.cc:3:18: error: expected unqualified-id before 'for'
    3 | #define rep(i,N) for(int i=0;i<int(N);++i)
      |                  ^~~
a.cc:58:5: note: in expansion of macro 'rep'
   58 |     rep(i,M){
      |     ^~~
a.cc:58:9: error: 'i' does not name a type
   58 |     rep(i,M){
      |         ^
a.cc:3:30: note: in definition of macro 'rep'
    3 | #define rep(i,N) for(int i=0;i<int(N);++i)
      |                              ^
a.cc:3:39: error: expected unqualified-id before '++' token
    3 | #define rep(i,N) for(int i=0;i<int(N);++i)
      |                                       ^~
a.cc:58:5: note: in expansion of macro 'rep'
   58 |     rep(i,M){
      |     ^~~
a.cc:61:1: error: expected declaration before '}' token
   61 | }
      | ^
Language: C

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

#define ll long long

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	
	int n, m;
	cin >> n >> m;
	int a=1, b=2;
	while(m--) {
		cout << a << " " << b << '\n';
		++a, ++b;
	}
}

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

#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
const int N=2e5+10;

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


Compiler output:
a.cc:30:1: error: expected declaration before '}' token
   30 | }
      | ^
Language: C++

#include<iostream>

using namespace std;

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

	int i = 1;
	int j = n;

	int step = max(1, (n/2) / m)
	
	for (; i < m;)
	{
		cout << i + 1 << " " << n - 1 - i << endl;
		i += step;
		j += step;
	}
	
	
	return 0;
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:9: error: expected ',' or ';' before 'for'
   16 |         for (; i < m;)
      |         ^~~
a.cc:16:22: error: expected primary-expression before ')' token
   16 |         for (; i < m;)
      |                      ^
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
#include <ctime>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <cassert>
#include <bitset>
#include <list>
#include <cstdio>
#include <stdio.h>
#include <string.h>
#include <limits.h>
#include <math.h>
#include <cmath>
#include <tuple>
#include <cassert>
#include <array>
#include <iomanip>

using namespace std;
using ll = long long;
using pii = pair<int, int>;
using ti = tuple<int, int, int>;

#define pb push_back
#define mp make_pair
#define debug(x) cerr << #x << ": " << x << endl
// #define int long long 

const double eps=1e-14;
const int mod = 1e9 + 7;
const int inf = ((1<<30)-1);
const ll linf = (1LL<<60);
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

int main()
{
    int n, m;
    cin >> n >> m;
    if(n%2)
    {
        for(int l=1, r=n-1; l<r; l++, r--)
        {
            printf("%d %d\n", l, r);
        }
    }
    else
    {
        for(int l=1, r=n-1; l<r; l++, r--)
        {
            if(!flag && r-1 <= n/2)
            {
                r--;
                flag = true;
            }
            printf("%d %d\n", l, r);
        }
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:57:17: error: 'flag' was not declared in this scope
   57 |             if(!flag && r-1 <= n/2)
      |                 ^~~~
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
#include <ctime>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <cassert>
#include <bitset>
#include <list>
#include <cstdio>
#include <stdio.h>
#include <string.h>
#include <limits.h>
#include <math.h>
#include <cmath>
#include <tuple>
#include <cassert>
#include <array>
#include <iomanip>

using namespace std;
using ll = long long;
using pii = pair<int, int>;
using ti = tuple<int, int, int>;

#define pb push_back
#define mp make_pair
#define debug(x) cerr << #x << ": " << x << endl
// #define int long long 

const double eps=1e-14;
const int mod = 1e9 + 7;
const int inf = ((1<<30)-1);
const ll linf = (1LL<<60);
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

int main()
{
    int n, m;
    cin >> n >> m;
    if(n%2)
    {
        for(int l=1, r=n-1; l<r; l++, r--)
        {
            printf("%d %d\n", l, r)
        }
    }
    else
    {
        for(int l=1, r=n-1; l<r; l++, r--)
        {
            if(!flag && r-1 <= n/2)
            {
                r--;
                flag = true;
            }
            printf("%d %d\n", l, r);
        }
    }
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:50:36: error: expected ';' before '}' token
   50 |             printf("%d %d\n", l, r)
      |                                    ^
      |                                    ;
   51 |         }
      |         ~                           
a.cc:57:17: error: 'flag' was not declared in this scope
   57 |             if(!flag && r-1 <= n/2)
      |                 ^~~~
Language: C++

//競技プログラミング用のテンプレート
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <queue>
#include <string>
#include <math.h>
#include <stack>

#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define repr(i, n) for(int i = n - 1; i >= 0; i--)

using namespace std;
using ll = long long int;
using p = pair<int, int>;
using pl = pair<ll, ll>;
using v = vector<int>;
using vd = vector<double>;
using vs = vector<string>;
using vl = vector<ll>;

int main()
{
  int n, m;
  cin >> n >> m;
  vector<pair<int, int>> t(m, {0, 0});
  if(n % 2 != 0) {
    int l = 1;
    int r = n;
    for(int i = 0; i < m; i++)
    {
      t[i] = {l, r};
      l++;
      r--;
    }
  }else{
    int l = 1;
    int r = n - 1;
    bool flag = false
    for(int i = 0; i < m; i++)
    {
      if((r - l == n - r + l) && !flag) {
        r--;
        flag = true;
      }
      t[i] = {l, r};
      l++;
      r--;
    }
  }
  for(auto e : t) {
    cout << e.first << " " << e.second << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:41:5: error: expected ',' or ';' before 'for'
   41 |     for(int i = 0; i < m; i++)
      |     ^~~
a.cc:41:20: error: 'i' was not declared in this scope
   41 |     for(int i = 0; i < m; i++)
      |                    ^
Language: Java

import java.util.*;
public class Main
{
  public static void main(String args[])
  {
    Scanner sc=new Scanner(System.in);
    int n=sc.nextInt();
    int m=sc.nextInt();
    int[] arr=new int[n];
    for(int i=0;i<n;i++)
      arr[i]=i+1;
    for(int i=0;i<(int)(n/2);i++)
    {
      System.out.println(arr[i]+" "+arr[arr.length()-1-i]);
    }
  }
}

Compiler output:
Main.java:14: error: cannot find symbol
      System.out.println(arr[i]+" "+arr[arr.length()-1-i]);
                                           ^
  symbol:   method length()
  location: variable arr of type int[]
1 error
Language: C++

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

long long n, m;

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


Compiler output:
a.cc: In function 'int main()':
a.cc:10:57: error: 'N' was not declared in this scope
   10 |     for (int i = 0; i < m; ++i) cout << i + 1 << " " << N - i << endl;
      |                                                         ^
Language: C++

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

int main(){
  int n,m;cin>>n>>m;
	set<int> dl;
	int p=0;
  for(int i=0;i<m;i++){
		int a=i+1+p;
		int b=n-i;
		int d1=b-a:
		int d2=a-1+n-b;
		if(!dl.count(d1)&&!dl.count(d2)){
			cout<<a<<" "<<b<<endl;
			dl.insert(d1);
			dl.insert(d2);
		}else{
			p=1;
			a=i+1+p;
			b=n-i;
		    d1=b-a:
		    d2=a-1+n-b;
			cout<<a<<" "<<b<<endl;
			dl.insert(d1);
			dl.insert(d2);
		}
  }
  return 0;
}  



Compiler output:
a.cc: In function 'int main()':
a.cc:12:27: error: expected ',' or ';' before ':' token
   12 |                 int d1=b-a:
      |                           ^
a.cc:14:45: error: 'd2' was not declared in this scope; did you mean 'd1'?
   14 |                 if(!dl.count(d1)&&!dl.count(d2)){
      |                                             ^~
      |                                             d1
a.cc:22:27: error: found ':' in nested-name-specifier, expected '::'
   22 |                     d1=b-a:
      |                           ^
      |                           ::
a.cc:22:26: error: 'a' is not a class, namespace, or enumeration
   22 |                     d1=b-a:
      |                          ^
Language: C++

#include<iostream>
using namespace std;

int main(){
  int n,m;cin>>n>>m;
	set<int> dl;
	int p=0;
  for(int i=0;i<m;i++){
		int a=i+1+p;
		int b=n-i;
		int d1=b-a:
		int d2=a-1+n-b;
		if(!dl.count(d1)&&!dl.count(d2)){
			cout<<a<<" "<<b<<endl;
			dl.insert(d1);
			dl.insert(d2);
		}else{
			p=1;
			a=i+1+p;
			b=n-i;
			cout<<a<<" "<<b<<endl;
		}
  }
  return 0;
}  



Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: 'set' was not declared in this scope
    6 |         set<int> dl;
      |         ^~~
a.cc:2:1: note: 'std::set' is defined in header '<set>'; this is probably fixable by adding '#include <set>'
    1 | #include<iostream>
  +++ |+#include <set>
    2 | using namespace std;
a.cc:6:13: error: expected primary-expression before 'int'
    6 |         set<int> dl;
      |             ^~~
a.cc:11:27: error: expected ',' or ';' before ':' token
   11 |                 int d1=b-a:
      |                           ^
a.cc:13:21: error: 'dl' was not declared in this scope; did you mean 'd1'?
   13 |                 if(!dl.count(d1)&&!dl.count(d2)){
      |                     ^~
      |                     d1
a.cc:13:45: error: 'd2' was not declared in this scope; did you mean 'd1'?
   13 |                 if(!dl.count(d1)&&!dl.count(d2)){
      |                                             ^~
      |                                             d1
Language: C++

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


Compiler output:
a.cc:3:5: error: cannot declare '::main' to be a global variable
    3 | int main {
      |     ^~~~
a.cc:4:3: error: expected primary-expression before 'int'
    4 |   int n,m;
      |   ^~~
a.cc:4:3: error: expected '}' before 'int'
a.cc:3:10: note: to match this '{'
    3 | int main {
      |          ^
a.cc:5:3: error: 'cin' does not name a type
    5 |   cin>>n>>m;
      |   ^~~
a.cc:6:3: error: expected unqualified-id before 'for'
    6 |   for(int i=1;i<=m;++i)
      |   ^~~
a.cc:6:15: error: 'i' does not name a type
    6 |   for(int i=1;i<=m;++i)
      |               ^
a.cc:6:20: error: expected unqualified-id before '++' token
    6 |   for(int i=1;i<=m;++i)
      |                    ^~
a.cc:8:3: error: expected unqualified-id before 'return'
    8 |   return 0;
      |   ^~~~~~
a.cc:9:1: error: expected declaration before '}' token
    9 | }
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
  ll n,m;
  cin>>n>>m;
  ll c=1;
  FOR(i,0,m)
  {
    cout<<c<<" ";
    c++;
    cout<<c<<"\n";
    c++;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:7: error: 'i' was not declared in this scope
    9 |   FOR(i,0,m)
      |       ^
a.cc:9:3: error: 'FOR' was not declared in this scope
    9 |   FOR(i,0,m)
      |   ^~~
Language: Java

import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc =new Scanner(System.in);
    int N =sc.nextInt();
    int M =sc.nextInt();
    if(N%2==1){
    for(int i=1;i<=M;i++){
      int C =N-i+1;
      System.out.println(i+" "+C);}}
    else{
      int n=N%2;
      if(n%2==0){
        for(int j=1;j<n;j++){
          int D =n-j;
          System.out.println(j+" "+D);}
        for(int k=1;k<=M-n+1;k++){
          int E =n+k-1;
          int F =M-k+1;
          System.out.println(E+" "+F);}}
      else{
        for(int l=1;l<=n;l++){
          int G =n-l+1;
          System.out.println(l+" "+G);}
        for(int m=1;m<=M-n+1;m++){
          int H =n+m;
          int I =M-m+1;
          System.out.println(H+" "+I);}}
  }
}


Compiler output:
Main.java:30: error: reached end of file while parsing
}
 ^
1 error
Language: Java

import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc =new Scanner(System.in);
    int N =sc.nextInt();
    int M =sc.nextInt();
    for(int i=1;i<=M;i++){
      System.out.println(i+" "+ N-i+1);}
  }
}


Compiler output:
Main.java:8: error: bad operand types for binary operator '-'
      System.out.println(i+" "+ N-i+1);}
                                 ^
  first type:  String
  second type: int
1 error
Language: Java

import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc =new Scanner(System.in);
    int N =sc.nextInt();
    int M =sc.nextInt();
    for(int i=1;i<=M;i++){
      System.out.println(i+" "+N-i+1);}
  }
}

Compiler output:
Main.java:8: error: bad operand types for binary operator '-'
      System.out.println(i+" "+N-i+1);}
                                ^
  first type:  String
  second type: int
1 error
Language: C++

//Optional FAST

//#pragma GCC optimize("Ofast")
//#pragma GCC optimize("unroll-loops")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,fma,abm,mmx,avx,avx2,tune=native")

//Required Libraries

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>

//Required namespaces

using namespace std;
using namespace __gnu_pbds;

//Required defines

#define endl '\n'

#define READ(X) cin>>X;
#define READV(X) long long X; cin>>X;
#define READAR(A,N) long long A[N]; for(long long i=0;i<N;i++) {cin>>A[i];}
#define rz(A,N) A.resize(N);
#define sz(X) (long long)(X.size())
#define pb push_back
#define pf push_front
#define fi first
#define se second
#define trav(x,A) for(auto &x:A)
#define FORI(a,b,c) for(long long a=b;a<c;a++)
#define FORD(a,b,c) for(long long a=b;a>c;a--)

//Required typedefs

typedef tree<long long,null_type,less<long long>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;
typedef tree<long long,null_type,greater<long long>,rb_tree_tag,tree_order_statistics_node_update> ordered_set1;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<long long,long long> pll;
typedef vector<int> veci;
typedef vector<long long> vecl;

//Required Constants

const long long inf=(long long)1e18;
const long long MOD=(long long)(1e9+7);
const long long INIT=(long long)(1e6+1);

//Required Functions

ll power(ll x,ll y) 
{ 
    if (y == 0) 
        return 1; 
    ll p = power(x, y/2) % MOD; 
    p = (p * p) % MOD; 
  
    return (y%2 == 0)? p : (x * p) % MOD; 
}
ll modInverse(ll a) 
{ 
   return power(a,MOD-2); 
   
}

//Work

int main()
{
    #ifndef ONLINE_JUDGE
    if (fopen("INPUT.txt", "r"))
    {
        freopen ("INPUT.txt" , "r" , stdin);
        //freopen ("OUTPUT.txt" , "w" , stdout);
    }
    #endif
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    clock_t clk;
    clk = clock();
//-----------------------------------------------------------------------------------------------------------//

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

//-----------------------------------------------------------------------------------------------------------//


    clk = clock() - clk;
    cerr << fixed << setprecision(6) << "Time: " << ((double)clk)/CLOCKS_PER_SEC << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:93:19: error: unable to find numeric literal operator 'operator""M'
   93 |         FORI(i,1,+1M)
      |                   ^~
a.cc:33:41: note: in definition of macro 'FORI'
   33 | #define FORI(a,b,c) for(long long a=b;a<c;a++)
      |                                         ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
typedef long long ll;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;
 
template<class T>
inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}
 
template<class T>
inline bool chmin(T &a, T b) {
    if(a > b) {
        a = b;
        return true;
    }
    return false;
}
 
const ll INF = 1e18;
const ll MOD = 998244353;
const ll MX = 1000001;
 
ll N, M;
 
void solve() {
    cin >> N >> M;
    if (N % 2) {
        for (int i = 0; i < M; i++) {
            cout << i + 1 << " " << N - i << "\n";
        }
    } else {
        bool extra = false;
        for (int i = 0; i < M; i++) {
            if (N - i - (i + 1) <= N / 2 || ) {
                extra = true;
            }
            
            if (!extra) cout << i + 1 << " " << N - i << "\n";
            else cout << i + 1 << " " << N - (i + 1)<< "\n";
        }
    }
}
 
int main() {
	cin.sync_with_stdio(0); cin.tie(0);
    ll T = 1; // cin >> T;
    while (T--) solve();
    return 0;
    // You should actually read the stuff at the bottom
}
 
/* Stuff to Look For
 * -----------------
 * Int overflow, array bounds
 * Initializing all variables, avoid weird behavior
 * Edge cases(n = 0, n = 1)
 * Just return 0 after result
 */


Compiler output:
a.cc: In function 'void solve()':
a.cc:41:45: error: expected primary-expression before ')' token
   41 |             if (N - i - (i + 1) <= N / 2 || ) {
      |                                             ^
Language: C++

#include <stdio.h>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <list>
#include <queue>
#include <stack>
#include <cmath>
#include <ctime>
#include <cstdio>
#include <vector>
#include <string>
#include <bitset>
#include <cctype>
#include <cstdlib>
#include <cstring>
#include <utility>
#include <numeric>
#include <complex>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <cassert>
#include <iostream>
#include <iterator>
#include <algorithm>
#include <functional>
using namespace std;
typedef long long ll;
const double EPS = 1e-9;
typedef vector<int> vint;
typedef vector<vector<int>> v2int;
typedef vector<ll> vll;
typedef vector<vector<ll>> v2ll;
typedef list<int> liint;
typedef pair<int, int> pint;
const int INF = int(2e9);
const ll LINF = ll(2e9) * ll(2e9);
#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for(int i = x; i < n; i++)
template<class T, class C> void chmax(T& a, C b) { a > b ? : a = b; }
template<class T, class C> void chmin(T& a, C b) { a < b ? : a = b; }



int Amain() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int N;
    cin >> N;
    ll ans = 0;
    cout << ans << endl;
    return 0;
}

Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
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){
     ll k= n/4 ;
          if(k<=m){
          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{
      for(ll i=1;i<=m;i++){
          cout<<i<<" "<<n-i+1
      }
  }
  }
  
    
 else{
  rep(i,m){
  cout <<i+1<<" "<<n-i<<endl ; 
  } 
 }return 0;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:30: error: expected ';' before '}' token
   26 |           cout<<i<<" "<<n-i+1
      |                              ^
      |                              ;
   27 |       }
      |       ~
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{
  for(ll h=1 ;h<=m;h++){
  cout <<h<<" "<<n-h+1<<endl ; 
  } 
 }return 0;



Compiler output:
a.cc: In function 'int main()':
a.cc:38:12: error: expected '}' at end of input
   38 |  }return 0;
      |            ^
a.cc:11:12: note: to match this '{'
   11 | int main() {
      |            ^
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{
  for(ll i=i ;i<=m;i++){
  cout <<i<<" "<<n-i+1<<endl ; 
  } 
 }return 0;



Compiler output:
a.cc: In function 'int main()':
a.cc:38:12: error: expected '}' at end of input
   38 |  }return 0;
      |            ^
a.cc:11:12: note: to match this '{'
   11 | int main() {
      |            ^
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{
  for(ll i=i ;i<=m;i++){
  cout <<i<<" "<<n<<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++){
      |                      ^
a.cc:38:12: error: expected '}' at end of input
   38 |  }return 0;
      |            ^
a.cc:11:12: note: to match this '{'
   11 | int main() {
      |            ^
Language: C++

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

int main(){
  long long M,N;
  cin  >> N >> M ;
 // if(N%2==1){
    int a=1;
    int b=2*M;
    cout << a << ' ' << b << endl;
    rep(i,M-1){
      a++;
      b--;
      cout << a << ' ' << b << endl;
    }
 // }
 

Compiler output:
a.cc: In function 'int main()':
a.cc:20:6: error: expected '}' at end of input
   20 |     }
      |      ^
a.cc:9:11: note: to match this '{'
    9 | int main(){
      |           ^
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{
  for(ll i=i ;i<=m;i++){
  cout <<i+1<<" "<<n-i<<endl ; 
  } 
 }return 0;



Compiler output:
a.cc: In function 'int main()':
a.cc:38:12: error: expected '}' at end of input
   38 |  }return 0;
      |            ^
a.cc:11:12: note: to match this '{'
   11 | int main() {
      |            ^
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{
  for(ll i=i ;i<=m;i++){
  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++){
      |                      ^
a.cc:38:12: error: expected '}' at end of input
   38 |  }return 0;
      |            ^
a.cc:11:12: note: to match this '{'
   11 | int main() {
      |            ^
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{
  for(ll i=1;i<=m;i++){
  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++){
      |                      ^