Language: C++

// include
//------------------------------------------
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>

using namespace std;

// conversion
//------------------------------------------
inline int toint(string s) {
    int v;
    istringstream sin(s);
    sin >> v;
    return v;
}
template <class t>
inline string tostring(t x) {
    ostringstream sout;
    sout << x;
    return sout.str();
}

// math
//-------------------------------------------
template <class t>
inline t sqr(t x) {
    return x * x;
}

// typedef
//------------------------------------------
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef long long ll;

// container util
//------------------------------------------
#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define pb push_back
#define mp make_pair
#define sz(a) int((a).size())
#define each(i, c) \
    for (typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define exist(s, e) ((s).find(e) != (s).end())
#define sort(c) sort((c).begin(), (c).end())

// repetition
//------------------------------------------
#define for(i, a, b) for (int i = (a); i < (b); ++i)
#define rep(i, n) for(i, 0, n)
#define repi(itr, ds) for (auto itr = ds.begin(); itr != ds.end(); itr++)

// constant
//--------------------------------------------
const double eps = 1e-10;
const double pi = acos(-1.0);

// clear memory
//--------------------------------------------
#define clr(a) memset((a), 0, sizeof(a))

// vector
//--------------------------------------------
template <typename t>
istream &operator>>(istream &is, vector<t> &vec) {
    for (t &x : vec) is >> x;
    return is;
}

// pair
//--------------------------------------------
template <typename t, typename u>
ostream &operator<<(ostream &os, pair<t, u> &pair_var) {
    os << "(" << pair_var.first << ", " << pair_var.second << ")";
    return os;
}

// vector
//--------------------------------------------
template <typename t>
ostream &operator<<(ostream &os, const vector<t> &vec) {
    os << "{";
    for (int i = 0; i < vec.size(); i++) {
        os << vec[i] << (i + 1 == vec.size() ? "" : ", ");
    }
    os << "}";
    return os;
}

// list
//--------------------------------------------
template <typename t>
ostream &operator<<(ostream &os, const list<t> &lst) {
    os << "{";
    repi(itr, lst) {
        os << *itr;
        itr++;
        if (itr != lst.end()) os << ", ";
        itr--;
    }
    os << "}";
    return os;
}

// map
//--------------------------------------------
template <typename t, typename u>
ostream &operator<<(ostream &os, map<t, u> &map_var) {
    os << "{";
    repi(itr, map_var) {
        os << *itr;
        itr++;
        if (itr != map_var.end()) os << ", ";
        itr--;
    }
    os << "}";
    return os;
}

// set
//--------------------------------------------
template <typename t>
ostream &operator<<(ostream &os, set<t> &set_var) {
    os << "{";
    repi(itr, set_var) {
        os << *itr;
        itr++;
        if (itr != set_var.end()) os << ", ";
        itr--;
    }
    os << "}";
    return os;
}

// dump
//--------------------------------------------
#define dumpout cerr

void dump_func() { dumpout << endl; }
template <class head, class... tail>
void dump_func(head &&head, tail &&... tail) {
    dumpout << head;
    if (sizeof...(tail) > 0) {
        dumpout << ", ";
    }
    dump_func(std::move(tail)...);
}
#ifdef debug_
#define deb
#define dump(...)                                                       \
    dumpout << "  " << string(#__va_args__) << ": "                     \
            << "[" << to_string(__line__) << ":" << __function__ << "]" \
            << endl                                                     \
            << "    ",                                                  \
        dump_func(__va_args__)
#else
#define deb if (false)
#define dump(...)
#endif

int n;
ll a[200001], b[200001];

int main(int argc, char *argv[]) {
    cin >> n;
    rep(i, n) { cin >> a[i] >> b[i]; }
    sort(a, a + n);
    sort(b, b + n);
    if (n % 2 != 0) {
        ll mid = b[n / 2] - a[n / 2];
        cout << mid + 1 << endl;
    } else {
        double mida = (a[n / 2] + a[n / 2 - 1]) / 2;
        double midb = (b[n / 2] + b[n / 2 - 1]) / 2;
        cout << (ll)(midb - mida) * 2 + 1 << endl;
    }
    return 0;
}


Compiler output:
a.cc:88:20: error: macro "for" requires 3 arguments, but only 1 given
   88 |     for (t &x : vec) is >> x;
      |                    ^
a.cc:71:9: note: macro "for" defined here
   71 | #define for(i, a, b) for (int i = (a); i < (b); ++i)
      |         ^~~
a.cc:105:40: error: macro "for" requires 3 arguments, but only 1 given
  105 |     for (int i = 0; i < vec.size(); i++) {
      |                                        ^
a.cc:71:9: note: macro "for" defined here
   71 | #define for(i, a, b) for (int i = (a); i < (b); ++i)
      |         ^~~
a.cc:117:18: error: macro "for" requires 3 arguments, but only 1 given
  117 |     repi(itr, lst) {
      |                  ^
a.cc:71:9: note: macro "for" defined here
   71 | #define for(i, a, b) for (int i = (a); i < (b); ++i)
      |         ^~~
a.cc:132:22: error: macro "for" requires 3 arguments, but only 1 given
  132 |     repi(itr, map_var) {
      |                      ^
a.cc:71:9: note: macro "for" defined here
   71 | #define for(i, a, b) for (int i = (a); i < (b); ++i)
      |         ^~~
a.cc:147:22: error: macro "for" requires 3 arguments, but only 1 given
  147 |     repi(itr, set_var) {
      |                      ^
a.cc:71:9: note: macro "for" defined here
   71 | #define for(i, a, b) for (int i = (a); i < (b); ++i)
      |         ^~~
a.cc:189:18: error: macro "sort" passed 2 arguments, but takes just 1
  189 |     sort(a, a + n);
      |                  ^
a.cc:67:9: note: macro "sort" defined here
   67 | #define sort(c) sort((c).begin(), (c).end())
      |         ^~~~
a.cc:190:18: error: macro "sort" passed 2 arguments, but takes just 1
  190 |     sort(b, b + n);
      |                  ^
a.cc:67:9: note: macro "sort" defined here
   67 | #define sort(c) sort((c).begin(), (c).end())
      |         ^~~~
a.cc: In function 'std::istream& operator>>(std::istream&, std::vector<t>&)':
a.cc:88:22: error: expected '(' before 'is'
   88 |     for (t &x : vec) is >> x;
      |                      ^~
      |                      (
a.cc:88:28: error: 'x' was not declared in this scope
   88 |     for (t &x : vec) is >> x;
      |                            ^
a.cc:89:5: error: expected primary-expression before 'return'
   89 |     return is;
      |     ^~~~~~
a.cc:88:30: error: expected ';' before 'return'
   88 |     for (t &x : vec) is >> x;
      |                              ^
      |                              ;
   89 |     return is;
      |     ~~~~~~                    
a.cc:89:5: error: expected primary-expression before 'return'
   89 |     return is;
      |     ^~~~~~
a.cc:88:30: error: expected ')' before 'return'
   88 |     for (t &x : vec) is >> x;
      |                      ~~      ^
      |                              )
   89 |     return is;
      |     ~~~~~~                    
a.cc: In function 'std::ostream& operator<<(std::ostream&, const std::vector<t>&)':
a.cc:105:42: error: expected '(' before '{' token
  105 |     for (int i = 0; i < vec.size(); i++) {
      |                                          ^
      |                                          (
a.cc:105:42: error: expected primary-expression before '{' token
a.cc:109:5: error: expected primary-expression before 'return'
  109 |     return os;
      |     ^~~~~~
a.cc:108:15: error: expected ')' before 'return'
  108 |     os << "}";
      |               ^
      |               )
  109 |     return os;
      |     ~~~~~~     
a.cc:105:42: note: to match this '('
  105 |     for (int i = 0; i < vec.size(); i++) {
      |                                          ^
a.cc: In function 'std::ostream& operator<<(std::ostream&, const std::__cxx11::list<t>&)':
a.cc:117:20: error: expected '(' before '{' token
  117 |     repi(itr, lst) {
      |                    ^
      |                    (
a.cc:117:20: error: expected primary-expression before '{' token
a.cc:124:5: error: expected primary-expression before 'return'
  124 |     return os;
      |     ^~~~~~
a.cc:123:15: error: expected ')' before 'return'
  123 |     os << "}";
      |               ^
      |               )
  124 |     return os;
      |     ~~~~~~     
a.cc:117:20: note: to match this '('
  117 |     repi(itr, lst) {
      |                    ^
a.cc: In function 'std::ostream& operator<<(std::ostream&, std::map<t, u>&)':
a.cc:132:24: error: expected '(' before '{' token
  132 |     repi(itr, map_var) {
      |                        ^
      |                        (
a.cc:132:24: error: expected primary-expression before '{' token
a.cc:139:5: error: expected primary-expression before 'return'
  139 |     return os;
      |     ^~~~~~
a.cc:138:15: error: expected ')' before 'return'
  138 |     os << "}";
      |               ^
      |               )
  139 |     return os;
      |     ~~~~~~     
a.cc:132:24: note: to match this '('
  132 |     repi(itr, map_var) {
      |                        ^
a.cc: In function 'std::ostream& operator<<(std::ostream&, std::set<t>&)':
a.cc:147:24: error: expected '(' before '{' token
  147 |     repi(itr, set_var) {
      |                        ^
      |                        (
a.cc:147:24: error: expected primary-expression before '{' token
a.cc:154:5: error: expected primary-expression before 'return'
  154 |     return os;
      |     ^~~~~~
a.cc:153:15: error: expected ')' before 'return'
  153 |     os << "}";
      |               ^
      |               )
  154 |     return os;
      |     ~~~~~~     
a.cc:147:24: note: to match this '('
  147 |     repi(itr, set_var) {
      |                        ^
a.cc: At global scope:
a.cc:163:23: error: declaration of 'head&& head' shadows template parameter
  163 | void dump_func(head &&head, tail &&... tail) {
      |                ~~~~~~~^~~~
a.cc:162:11: note: template parameter 'head' declared here
  162 | template <class head, class... tail>
      |           ^~~~~
a.cc:163:36: error: declaration of 'tail&& ... tail' shadows template parameter
  163 | void dump_func(head &&head, tail &&... tail) {
      |                             ~~~~~~~^~~~~~~~
a.cc:162:23: note: template parameter 'tail' declared here
  162 | template <class head, class... tail>
      |                       ^~~~~
a.cc: In function 'void dump_func(head&&, tail&& ...)':
a.cc:163:36: error: declaration of 'tail&& ... tail' shadows template parameter
  163 | void dump_func(head &&head, tail &&... tail) {
      |                             ~~~~~~~^~~~~~~~
a.cc:162:23: note: template parameter 'tail' declared here
  162 | template <class head, class... tail>
      |                       ^~~~~
a.cc:163:23: error: declaration of 'head&& head' shadows template parameter
  163 | void dump_func(head &&head, tail &&... tail) {
      |                ~~~~~~~^~~~
a.cc:162:11: note: template parameter 'head' declared here
  162 | template <class head, class... tail>
      |           ^~~~~
a.cc: In function 'int main(int, char**)':
a.cc:189:19: error: statement cannot resolve address of overloaded function
  189 |     sort(a, a + n);
      |                   ^
a.cc:190:19: error: statement cannot resolve address of overloaded function
  190 |     sort(b, b + n);
      |                   ^