-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsolve2.cpp
More file actions
36 lines (35 loc) · 890 Bytes
/
Copy pathsolve2.cpp
File metadata and controls
36 lines (35 loc) · 890 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include <bits/stdc++.h>
#define IOS ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define INF 0x3f3f3f3f
using namespace std;
typedef long long ll;
int main(){
IOS
int t;
cin >> t;
while(t--){
int n, s, m;
cin >> n >> s >> m;
int pre = 0;
bool judge = false;
vector<pair<int, int> > vec(n);
for(int i = 0;i < n;i++){
int l, r;
cin >> vec[i].first >> vec[i].second;
}
if(vec[0].first >= s){
cout << "YES" << '\n';
continue;
}
for(int i = 1;i < n;i++){
if(vec[i].first - vec[i - 1].second >= s){
judge = true;
break;
}
}
if(m - vec[n - 1].second >= s) judge = true;
if(judge) cout << "YES" << '\n';
else cout << "NO" << '\n';
}
return 0;
}