Language: C++

#define REP(i,p,n) for(int i=p;i<(int)(n);++i)
#define rep(i,n) REP(i,0,n)
#define dump(a) (cerr << #a << "=" << (a) << endl)
#define DUMP(list) cout << "{ "; for(auto nth : list){ cout << nth << " "; } cout << "}" << endl;
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; }

using namespace std;
typedef pair<ll, ll> pint;

const int MOD = 1000000007;
void yesno(bool b) {
    if (b) {
        cout << "Yes" << endl;
    }     else {
        cout << "No" << endl;
    }
}

int main() {
    int N, M;
    cin >> N >> M;
    ll l = 1;
    ll r = N;
    if (N % 2 == 0) {
        rep(i, M) {
            cout << l << " " << r << endl;
            l++;
            r--;
        }
    } else {
        r--;
        rep(i, M) {
            cout << l << " " << r << endl;
            l++;
            r--;
        }
    }
}


Compiler output:
a.cc:9:9: error: 'pair' does not name a type
    9 | typedef pair<ll, ll> pint;
      |         ^~~~
a.cc: In function 'void yesno(bool)':
a.cc:14:9: error: 'cout' was not declared in this scope
   14 |         cout << "Yes" << endl;
      |         ^~~~
a.cc:1:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #define REP(i,p,n) for(int i=p;i<(int)(n);++i)
a.cc:14:26: error: 'endl' was not declared in this scope
   14 |         cout << "Yes" << endl;
      |                          ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #define REP(i,p,n) for(int i=p;i<(int)(n);++i)
a.cc:16:9: error: 'cout' was not declared in this scope
   16 |         cout << "No" << endl;
      |         ^~~~
a.cc:16:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:16:25: error: 'endl' was not declared in this scope
   16 |         cout << "No" << endl;
      |                         ^~~~
a.cc:16:25: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
a.cc: In function 'int main()':
a.cc:22:5: error: 'cin' was not declared in this scope
   22 |     cin >> N >> M;
      |     ^~~
a.cc:22:5: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:23:5: error: 'll' was not declared in this scope
   23 |     ll l = 1;
      |     ^~
a.cc:24:7: error: expected ';' before 'r'
   24 |     ll r = N;
      |       ^~
      |       ;
a.cc:27:13: error: 'cout' was not declared in this scope
   27 |             cout << l << " " << r << endl;
      |             ^~~~
a.cc:27:13: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:27:21: error: 'l' was not declared in this scope
   27 |             cout << l << " " << r << endl;
      |                     ^
a.cc:27:33: error: 'r' was not declared in this scope
   27 |             cout << l << " " << r << endl;
      |                                 ^
a.cc:27:38: error: 'endl' was not declared in this scope
   27 |             cout << l << " " << r << endl;
      |                                      ^~~~
a.cc:27:38: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
a.cc:32:9: error: 'r' was not declared in this scope
   32 |         r--;
      |         ^
a.cc:34:13: error: 'cout' was not declared in this scope
   34 |             cout << l << " " << r << endl;
      |             ^~~~
a.cc:34:13: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:34:21: error: 'l' was not declared in this scope
   34 |             cout << l << " " << r << endl;
      |                     ^
a.cc:34:38: error: 'endl' was not declared in this scope
   34 |             cout << l << " " << r << endl;
      |                                      ^~~~
a.cc:34:38: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'