Language: C++

using namespace std;
 
int main() {
    int n;
    cin >> n;
    vector<pair<int, int>> ab(n);
 
    for (int i = 0; i < n; i++) {
        cin >> ab[i].first >> ab[i].second;
    }
 
    sort(ab.begin(), ab.end(),
        [](const pair<int, int>& x, const pair<int, int>& y) {return x.second < y.second; });
 
    int cTime = 0;
    for (int i = 0; i < n; i++) {
        cTime += ab[i].first;
        if (cTime > ab[i].second) {
            cout << "No";
            return 0;
        }
    }
    cout << "Yes";
 
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:5: error: 'cin' was not declared in this scope
    5 |     cin >> n;
      |     ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:6:5: error: 'vector' was not declared in this scope
    6 |     vector<pair<int, int>> ab(n);
      |     ^~~~~~
a.cc:1:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
  +++ |+#include <vector>
    1 | using namespace std;
a.cc:6:12: error: 'pair' was not declared in this scope
    6 |     vector<pair<int, int>> ab(n);
      |            ^~~~
a.cc:1:1: note: 'std::pair' is defined in header '<utility>'; this is probably fixable by adding '#include <utility>'
  +++ |+#include <utility>
    1 | using namespace std;
a.cc:6:17: error: expected primary-expression before 'int'
    6 |     vector<pair<int, int>> ab(n);
      |                 ^~~
a.cc:9:16: error: 'ab' was not declared in this scope
    9 |         cin >> ab[i].first >> ab[i].second;
      |                ^~
a.cc:12:10: error: 'ab' was not declared in this scope
   12 |     sort(ab.begin(), ab.end(),
      |          ^~
a.cc:13:18: error: 'pair' does not name a type
   13 |         [](const pair<int, int>& x, const pair<int, int>& y) {return x.second < y.second; });
      |                  ^~~~
a.cc: In lambda function:
a.cc:13:93: error: expected '{' before ';' token
   13 |         [](const pair<int, int>& x, const pair<int, int>& y) {return x.second < y.second; });
      |                                                                                             ^
a.cc: In function 'int main()':
a.cc:13:93: error: expected ')' before ';' token
   13 |         [](const pair<int, int>& x, const pair<int, int>& y) {return x.second < y.second; });
      |                                                                                             ^
      |                                                                                             )
a.cc:12:9: note: to match this '('
   12 |     sort(ab.begin(), ab.end(),
      |         ^
a.cc:19:13: error: 'cout' was not declared in this scope
   19 |             cout << "No";
      |             ^~~~
a.cc:19:13: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:23:5: error: 'cout' was not declared in this scope
   23 |     cout << "Yes";
      |     ^~~~
a.cc:23:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'