Language: C++

#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
#define rep(i, j) for(int i = 0; i < j; i++)
#define for(i, j, k) for(int i = j; i < k; i++)

int main(){
  int n, r;
  while(cin >>n >>r && n){
    vector<int> v;
    for(int i = n; i > 0; i--) v.push_back(i);

    rep(i, r){
      int p, c;
      cin >>p >>c;
      vector<int> next;
      for(int i = 0; i < c; i++) next.push_back(v[p - 1 + i]);
      for(int i = 0; i < p - 1; i++) next.push_back(v[i]);
      for(int i = p + c - 1; i < v.size(); i++) next.push_back(v[i]);
      v = next;
    }
    cout <<v[0] <<endl;
  }
  return 0;
}

Compiler output:
a.cc:12:30: error: macro "for" requires 3 arguments, but only 1 given
   12 |     for(int i = n; i > 0; i--) v.push_back(i);
      |                              ^
a.cc:6:9: note: macro "for" defined here
    6 | #define for(i, j, k) for(int i = j; i < k; i++)
      |         ^~~
a.cc:14:13: error: macro "for" requires 3 arguments, but only 1 given
   14 |     rep(i, r){
      |             ^
a.cc:6:9: note: macro "for" defined here
    6 | #define for(i, j, k) for(int i = j; i < k; i++)
      |         ^~~
a.cc:18:32: error: macro "for" requires 3 arguments, but only 1 given
   18 |       for(int i = 0; i < c; i++) next.push_back(v[p - 1 + i]);
      |                                ^
a.cc:6:9: note: macro "for" defined here
    6 | #define for(i, j, k) for(int i = j; i < k; i++)
      |         ^~~
a.cc:19:36: error: macro "for" requires 3 arguments, but only 1 given
   19 |       for(int i = 0; i < p - 1; i++) next.push_back(v[i]);
      |                                    ^
a.cc:6:9: note: macro "for" defined here
    6 | #define for(i, j, k) for(int i = j; i < k; i++)
      |         ^~~
a.cc:20:47: error: macro "for" requires 3 arguments, but only 1 given
   20 |       for(int i = p + c - 1; i < v.size(); i++) next.push_back(v[i]);
      |                                               ^
a.cc:6:9: note: macro "for" defined here
    6 | #define for(i, j, k) for(int i = j; i < k; i++)
      |         ^~~
a.cc: In function 'int main()':
a.cc:12:32: error: expected '(' before 'v'
   12 |     for(int i = n; i > 0; i--) v.push_back(i);
      |                                ^
      |                                (
a.cc:12:44: error: 'i' was not declared in this scope
   12 |     for(int i = n; i > 0; i--) v.push_back(i);
      |                                            ^
a.cc:5:19: error: expected primary-expression before 'for'
    5 | #define rep(i, j) for(int i = 0; i < j; i++)
      |                   ^~~
a.cc:14:5: note: in expansion of macro 'rep'
   14 |     rep(i, r){
      |     ^~~
a.cc:12:47: error: expected ';' before 'for'
   12 |     for(int i = n; i > 0; i--) v.push_back(i);
      |                                               ^
      |                                               ;
a.cc:5:19: error: expected primary-expression before 'for'
    5 | #define rep(i, j) for(int i = 0; i < j; i++)
      |                   ^~~
a.cc:14:5: note: in expansion of macro 'rep'
   14 |     rep(i, r){
      |     ^~~
a.cc:12:47: error: expected ')' before 'for'
   12 |     for(int i = n; i > 0; i--) v.push_back(i);
      |                                ~              ^
      |                                               )
a.cc:14:14: error: expected '(' before '{' token
   14 |     rep(i, r){
      |              ^
      |              (
a.cc:14:14: error: expected primary-expression before '{' token
a.cc:24:3: error: expected primary-expression before '}' token
   24 |   }
      |   ^
a.cc:23:24: error: expected ')' before '}' token
   23 |     cout <<v[0] <<endl;
      |                        ^
      |                        )
   24 |   }
      |   ~                     
a.cc:14:14: note: to match this '('
   14 |     rep(i, r){
      |              ^
a.cc:24:3: error: expected primary-expression before '}' token
   24 |   }
      |   ^