Language: C++

#include <string>
#include <vector>
#include <iostream>
#include <iomanip>
#include <cmath>
#include <algorithm>
#include <functional>
#include <utility>
#include <numeric>
#include <map>
using namespace std;


#define prec(i) cout << fixed << setprecision(i)

const long long MOD = 1000000007;

long long fact(long long k) {
	long long sum = 1;
	for (long long i = 2; i <= k; i++)
		sum *= i;

	return sum;
}

long long fact_mod(long long k) {
	long long sum = 1;
	for (long long i = 2; i <= k; i++)
		sum = (sum * i) % MOD;

	return sum;
}

int ctoi(char c) {
	if (c >= '0' && c <= '9')
		return c - '0';
	else
		return -1;
}

long long pow_mod(int a, int b) {
	long long ans = 1;
	for (int i = 0; i < b; i++)
		ans = (ans * a) % MOD;

	return ans;
}

long long powll(long long a, long long  b) {
	long long ans = 1;
	for (long long i = 0; i < b; i++)
		ans = ans * a;

	return ans;
}

long long modinv(long long a) {
	long long b = MOD, u = 1, v = 0;
	while (b) {
		long long t = a / b;
		a -= t * b; swap(a, b);
		u -= t * v; swap(u, v);
	}
	u %= MOD;
	if (u < 0) u += MOD;
	return u;
}




#include <string>
#include <vector>
#include <iostream>
#include <iomanip>
#include <cmath>
#include <algorithm>
#include <functional>
#include <utility>
#include <numeric>
#include <map>
using namespace std;


#define prec(i) cout << fixed << setprecision(i)

const long long MOD = 1000000007;

long long fact(long long k) {
	long long sum = 1;
	for (long long i = 2; i <= k; i++)
		sum *= i;

	return sum;
}

long long fact_mod(long long k) {
	long long sum = 1;
	for (long long i = 2; i <= k; i++)
		sum = (sum * i) % MOD;

	return sum;
}

int ctoi(char c) {
	if (c >= '0' && c <= '9')
		return c - '0';
	else
		return -1;
}

long long pow_mod(int a, int b) {
	long long ans = 1;
	for (int i = 0; i < b; i++)
		ans = (ans * a) % MOD;

	return ans;
}

long long powll(long long a, long long  b) {
	long long ans = 1;
	for (long long i = 0; i < b; i++)
		ans = ans * a;

	return ans;
}

long long modinv(long long a) {
	long long b = MOD, u = 1, v = 0;
	while (b) {
		long long t = a / b;
		a -= t * b; swap(a, b);
		u -= t * v; swap(u, v);
	}
	u %= MOD;
	if (u < 0) u += MOD;
	return u;
}




int main()
{
	long long n;

	cin >> n;

	vector<pair<long long, long long>> robot;
	vector<vector<long long>> hit(n);
	vector<long long> hitCnt(n);

	for (int i = 0; i < n; i++) {
		long long x, l;
		cin >> x >> l;
		robot.push_back(make_pair(x, l));
	}

	sort(robot.begin(), robot.end());

	int cnt = 0, max = 0, current = 0;
	for (int i = 0; i < n; i++) {
		cnt = 1;
		current = i;
		for (int j = i + 1; j < n; j++) {
			if (cnt + (n - j) <= max)
				break;

			if (robot[current].first + robot[current].second <= robot[j].first - robot[j].second) {
				current = j;
				cnt++;
			}
		}
		if (cnt > max)
			max = cnt;
	}



	cout << max << endl;

	return 0;
}

Compiler output:
a.cc:87:17: error: redefinition of 'const long long int MOD'
   87 | const long long MOD = 1000000007;
      |                 ^~~
a.cc:16:17: note: 'const long long int MOD' previously defined here
   16 | const long long MOD = 1000000007;
      |                 ^~~
a.cc:89:11: error: redefinition of 'long long int fact(long long int)'
   89 | long long fact(long long k) {
      |           ^~~~
a.cc:18:11: note: 'long long int fact(long long int)' previously defined here
   18 | long long fact(long long k) {
      |           ^~~~
a.cc:97:11: error: redefinition of 'long long int fact_mod(long long int)'
   97 | long long fact_mod(long long k) {
      |           ^~~~~~~~
a.cc:26:11: note: 'long long int fact_mod(long long int)' previously defined here
   26 | long long fact_mod(long long k) {
      |           ^~~~~~~~
a.cc:105:5: error: redefinition of 'int ctoi(char)'
  105 | int ctoi(char c) {
      |     ^~~~
a.cc:34:5: note: 'int ctoi(char)' previously defined here
   34 | int ctoi(char c) {
      |     ^~~~
a.cc:112:11: error: redefinition of 'long long int pow_mod(int, int)'
  112 | long long pow_mod(int a, int b) {
      |           ^~~~~~~
a.cc:41:11: note: 'long long int pow_mod(int, int)' previously defined here
   41 | long long pow_mod(int a, int b) {
      |           ^~~~~~~
a.cc:120:11: error: redefinition of 'long long int powll(long long int, long long int)'
  120 | long long powll(long long a, long long  b) {
      |           ^~~~~
a.cc:49:11: note: 'long long int powll(long long int, long long int)' previously defined here
   49 | long long powll(long long a, long long  b) {
      |           ^~~~~
a.cc:128:11: error: redefinition of 'long long int modinv(long long int)'
  128 | long long modinv(long long a) {
      |           ^~~~~~
a.cc:57:11: note: 'long long int modinv(long long int)' previously defined here
   57 | long long modinv(long long a) {
      |           ^~~~~~