QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#113393#6392. CurtainsLFCode60 70ms58100kbC++141.9kb2023-06-17 13:59:342023-06-17 13:59:37

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-06-17 13:59:37]
  • 评测
  • 测评结果:60
  • 用时:70ms
  • 内存:58100kb
  • [2023-06-17 13:59:34]
  • 提交

answer

#include<cstdio>
#include<vector>
using std::vector;
const int N=500086;
int n,m,q,st[N],ql[N],qr[N],mxl[N],mnr[N],ans[N];
bool p[N];
vector<int>vl[N],vr[N],vq[N];
int Max(int a,int b){return a>b?a:b;}
int Min(int a,int b){return a<b?a:b;}
int read(){
	char ch=getchar();int nn=0,ssss=1;
	while(ch<'0'||ch>'9'){if(ch=='-')ssss*=-1;ch=getchar();}
	while(ch>='0'&&ch<='9'){nn=nn*10+(ch-'0');ch=getchar();}
	return nn*ssss;
}
bool pushq(int k,int l,int r,int x){
	int mid=(l+r)>>1;if(l==r||(ql[x]<=mid&&qr[x]>mid)){vq[k].push_back(x);return true;}
	return qr[x]<=mid?pushq(k<<1,l,mid,x):pushq(k<<1|1,mid+1,r,x);
}
bool Div(int k,int l,int r){
	if(l==r){
		if(p[l])
			for(vector<int>::iterator it=vq[k].begin();it!=vq[k].end();it++)
				ans[*it]=true;
		return true;
	}
	int mid=(l+r)>>1;Div(k<<1,l,mid);Div(k<<1|1,mid+1,r);
	for(int i=mid,tp=0;i>=l;i--){
		mnr[i]=r+1;int mr=0;
		for(vector<int>::iterator it=vl[i].begin();it!=vl[i].end();it++){
			if(*it>r)continue;
			if(*it<mid)mr=Max(mr,*it);else mnr[i]=Min(mnr[i],*it);
		}
		while(tp&&(st[tp]<=mr+1||mnr[st[tp]]>=mnr[i]))mnr[i]=Min(mnr[i],mnr[st[tp--]]);
		st[++tp]=i;
	}
	for(int i=mid+1,tp=0;i<=r;i++){
		mxl[i]=0;int ml=r+1;
		for(vector<int>::iterator it=vr[i].begin();it!=vr[i].end();it++){
			if(*it<l)continue;
			if(*it>mid+1)ml=Min(ml,*it);else mxl[i]=Max(mxl[i],*it);
		}
		while(tp&&(st[tp]>=ml-1||mxl[st[tp]]<=mxl[i]))mxl[i]=Max(mxl[i],mxl[st[tp--]]);
		st[++tp]=i;
	}
	for(vector<int>::iterator it=vq[k].begin();it!=vq[k].end();it++)
		ans[*it]=mnr[ql[*it]]<=qr[*it]&&mxl[qr[*it]]>=ql[*it];
	return true;
}
int main(){
//	freopen("data.in","r",stdin);
	n=read();m=read();q=read();
	for(int i=1;i<=m;i++){
		int l=read();int r=read();if(l==r)p[l]=true;
		vl[l].push_back(r);vr[r].push_back(l);
	}
	for(int i=1;i<=q;i++){ql[i]=read();qr[i]=read();pushq(1,1,n,i);}
	Div(1,1,n);for(int i=1;i<=q;i++)if(ans[i])puts("YES");else puts("NO");
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 3
Accepted

Test #1:

score: 3
Accepted
time: 8ms
memory: 49188kb

input:

200 200 200
113 134
77 77
110 143
126 157
122 131
161 172
59 134
19 68
117 142
15 103
61 182
12 67
73 97
72 128
68 110
19 137
14 118
60 150
42 64
25 30
118 158
149 164
79 149
21 94
33 82
3 130
36 142
57 170
64 140
40 98
115 132
2 45
27 85
43 181
120 125
82 160
121 176
16 154
59 74
34 52
71 74
57 185...

output:

NO
YES
NO
NO
YES
NO
NO
NO
YES
NO
NO
NO
NO
YES
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
YES
YES
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
YES
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
YES
NO
NO
NO
YES
NO
NO
NO
NO
YES
YES
YES
NO
YES
YES
YE...

result:

ok 200 lines

Test #2:

score: 0
Accepted
time: 1ms
memory: 49248kb

input:

200 200 200
177 200
1 17
123 127
19 53
172 177
4 16
44 132
97 124
94 143
15 71
96 140
61 181
109 162
28 95
108 162
24 146
84 107
20 154
92 118
133 141
55 58
73 154
35 86
83 124
9 90
92 114
46 81
35 62
45 83
11 52
11 178
35 188
128 156
20 87
102 150
22 157
21 34
7 174
27 48
2 75
159 191
30 95
140 153...

output:

YES
NO
NO
NO
NO
NO
NO
NO
YES
NO
YES
YES
YES
NO
NO
NO
NO
NO
YES
YES
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
YES
NO
NO
NO
NO
NO
YES
NO
YES
NO
YES
NO
NO
NO
YES
NO
NO
NO
NO
NO
YES
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
YES
NO
YES
NO
NO
NO
NO
YES
NO
YES
NO
NO
NO
NO
NO
NO
YES
NO
YES
NO
NO
YES
Y...

result:

ok 200 lines

Test #3:

score: 0
Accepted
time: 1ms
memory: 48704kb

input:

200 200 200
74 143
108 109
6 95
85 155
130 172
73 186
14 51
73 147
61 108
7 158
28 28
66 149
84 192
79 196
94 126
7 86
102 199
27 49
32 163
90 198
137 179
57 123
41 75
33 190
20 175
84 154
163 184
70 83
76 154
77 105
49 164
67 191
22 157
38 83
60 99
50 129
10 32
25 154
10 122
155 174
111 124
63 135
...

output:

YES
NO
YES
NO
NO
NO
NO
NO
NO
NO
YES
NO
YES
NO
NO
YES
YES
NO
NO
YES
NO
NO
YES
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
YES
NO
NO
NO
NO
NO
NO
YES
YES
YES
NO
NO
NO
YES
YES
NO
NO
NO
YES
NO
YES
NO
NO
YES
NO
NO
YES
NO
YES
NO
YES
NO
NO
NO
NO
YES
NO
YES
NO...

result:

ok 200 lines

Test #4:

score: 0
Accepted
time: 1ms
memory: 49944kb

input:

200 200 200
177 181
118 129
13 72
3 80
18 82
6 7
89 182
97 184
132 150
4 54
129 132
83 136
14 119
15 19
67 123
176 198
41 51
81 129
155 170
20 187
85 111
96 163
195 200
34 179
39 186
35 87
90 93
3 191
21 187
1 100
193 195
57 61
52 159
40 188
117 182
106 112
92 111
105 136
106 170
86 113
39 42
107 11...

output:

YES
NO
NO
YES
NO
YES
NO
YES
NO
YES
YES
NO
NO
YES
YES
NO
YES
NO
NO
NO
YES
NO
YES
NO
NO
NO
NO
NO
NO
YES
NO
YES
NO
NO
YES
NO
YES
YES
YES
NO
YES
NO
NO
NO
NO
NO
NO
NO
YES
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
YES
YES
YES
YES
NO
NO
NO
NO
NO
YES
YES
YES
NO
YES
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
YES
YES
NO
Y...

result:

ok 200 lines

Test #5:

score: 0
Accepted
time: 7ms
memory: 50032kb

input:

200 200 200
116 119
160 161
27 79
20 194
98 100
9 127
106 139
32 33
14 162
3 71
82 133
88 137
129 163
174 175
3 20
100 111
11 191
24 28
135 136
117 143
31 147
44 47
111 116
100 175
40 165
129 197
87 89
61 175
91 93
14 105
193 195
48 92
71 72
67 82
101 153
67 160
64 66
136 137
128 197
35 153
195 199
...

output:

YES
NO
YES
NO
NO
NO
YES
YES
YES
NO
YES
YES
NO
NO
YES
NO
NO
NO
NO
YES
YES
YES
NO
YES
NO
YES
NO
NO
NO
NO
YES
YES
NO
NO
YES
NO
YES
NO
YES
NO
NO
NO
YES
YES
YES
NO
NO
NO
YES
YES
YES
YES
YES
NO
YES
NO
NO
NO
YES
NO
NO
YES
YES
YES
NO
NO
NO
NO
NO
YES
NO
NO
YES
NO
YES
NO
YES
YES
NO
YES
NO
YES
YES
YES
NO
NO
NO...

result:

ok 200 lines

Test #6:

score: 0
Accepted
time: 3ms
memory: 49256kb

input:

200 200 200
18 98
42 142
96 162
170 184
6 35
113 155
16 136
22 177
36 95
50 114
44 76
17 44
87 173
124 189
20 48
47 101
66 188
68 138
100 171
23 49
67 184
119 189
47 81
24 27
58 122
38 95
12 96
90 131
16 165
46 86
33 59
25 122
126 145
132 190
32 114
45 183
22 36
27 199
190 193
22 126
60 80
58 179
22...

output:

NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
...

result:

ok 200 lines

Test #7:

score: 0
Accepted
time: 3ms
memory: 49956kb

input:

200 200 200
102 106
7 10
88 91
135 136
129 136
90 99
6 6
135 145
80 85
2 5
53 53
146 146
23 27
178 186
19 22
139 148
34 37
59 66
170 178
135 136
131 138
180 182
90 98
171 177
28 28
179 181
177 182
171 181
107 117
3 3
59 63
100 104
124 129
195 200
150 156
162 165
140 145
71 74
94 100
52 60
24 34
69 7...

output:

YES
NO
NO
NO
YES
NO
NO
YES
YES
YES
YES
YES
YES
NO
YES
YES
YES
YES
NO
YES
YES
YES
YES
YES
YES
YES
NO
YES
NO
YES
YES
YES
YES
YES
YES
NO
NO
YES
YES
NO
YES
NO
YES
NO
YES
NO
YES
YES
NO
NO
YES
YES
NO
NO
YES
YES
YES
YES
YES
NO
NO
YES
NO
NO
NO
NO
NO
YES
YES
NO
NO
NO
NO
YES
NO
YES
NO
NO
NO
YES
NO
YES
YES
YES...

result:

ok 200 lines

Test #8:

score: 0
Accepted
time: 4ms
memory: 49800kb

input:

200 200 200
123 125
128 131
157 165
37 47
31 34
200 200
13 14
184 194
145 153
39 41
8 18
117 122
26 33
173 179
150 152
31 37
52 53
169 175
45 51
198 199
53 60
98 104
74 74
4 5
184 188
105 110
14 21
116 119
142 150
168 172
121 130
56 65
145 152
89 90
126 129
130 130
50 53
154 163
21 22
170 172
71 79
...

output:

NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
...

result:

ok 200 lines

Test #9:

score: 0
Accepted
time: 1ms
memory: 49796kb

input:

200 200 200
150 150
127 127
102 102
62 62
47 47
192 192
63 63
50 50
37 37
173 173
169 169
66 66
183 183
171 171
104 104
75 75
184 184
128 128
57 57
197 197
163 163
193 193
199 199
153 153
25 25
175 175
98 98
80 80
120 120
106 106
181 181
113 113
143 143
130 130
121 121
185 185
172 172
78 78
125 125
...

output:

YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
...

result:

ok 200 lines

Test #10:

score: 0
Accepted
time: 5ms
memory: 48308kb

input:

200 100 200
150 159
165 174
79 88
29 38
64 73
157 166
59 68
102 111
159 168
60 69
116 125
134 143
190 199
65 74
114 123
176 185
2 11
97 106
166 175
31 40
152 161
47 56
68 77
126 135
10 19
81 90
178 187
70 79
101 110
75 84
169 178
90 99
73 82
103 112
172 181
16 25
141 150
143 152
167 176
23 32
37 46
...

output:

YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
YES
NO
NO
NO
NO
YES
NO
YES
YES
YES
YES
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
YES
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
...

result:

ok 200 lines

Subtask #2:

score: 6
Accepted

Dependency #1:

100%
Accepted

Test #11:

score: 6
Accepted
time: 3ms
memory: 48328kb

input:

2000 2000 2000
135 211
509 982
410 1776
192 1071
20 1129
821 872
407 1514
1321 1333
1425 1437
28 1936
655 1360
1353 1426
327 550
1036 1431
806 1791
1242 1247
371 651
622 1589
1491 1538
820 1828
431 1346
660 1372
712 1768
1414 1847
1329 1672
570 592
76 1838
427 1549
955 1598
790 1165
828 1784
1818 19...

output:

NO
NO
NO
NO
NO
NO
NO
YES
YES
NO
NO
NO
YES
NO
NO
NO
NO
NO
YES
YES
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
YES
NO
YES
NO
NO
NO
NO
YES
NO
NO
NO
NO...

result:

ok 2000 lines

Test #12:

score: 0
Accepted
time: 8ms
memory: 49228kb

input:

2000 2000 2000
177 1050
391 1762
1243 1903
591 1477
1428 1477
1844 1899
675 1056
1203 1512
156 1112
633 1264
537 1620
1430 1809
66 1499
213 1120
662 1725
957 1759
1223 1871
252 571
632 773
432 1139
292 1345
33 325
702 794
959 1989
3 474
1881 1936
536 1334
243 1922
690 826
36 1845
437 551
410 671
565...

output:

NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
YES
YES
YES
NO
NO
NO
NO
NO
NO
YES
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
YES
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
YES
YES
NO
NO
NO
YES
NO
NO
YES
YES
NO
NO
NO
YES
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
...

result:

ok 2000 lines

Test #13:

score: 0
Accepted
time: 3ms
memory: 48392kb

input:

2000 2000 2000
1 111
1485 1529
1252 1791
235 896
796 821
746 1876
1058 1098
111 134
196 1346
330 1959
735 1716
966 1792
181 1447
983 1526
1241 1933
38 1389
616 785
196 805
964 1373
424 1040
4 59
783 1768
509 685
1252 1661
1432 1796
576 1613
314 1715
12 287
263 1483
1672 1840
183 1254
460 485
156 128...

output:

NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
YES
NO
YES
YES
NO
YES
NO
NO
NO
YES
NO
NO
NO
NO
YES
NO
YES
YES
NO
YES
YES
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
YES
NO
YES
YES
YES
NO
NO
NO
YES
NO
NO
YES
NO
NO
YES
NO
NO
YES
NO
YES
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
YES
NO
NO
YES
NO
NO
NO
YES
NO
NO
NO
NO
NO
N...

result:

ok 2000 lines

Test #14:

score: 0
Accepted
time: 3ms
memory: 48992kb

input:

2000 2000 2000
1015 1694
501 987
18 485
744 748
896 1456
453 1925
617 1844
1287 1296
407 649
79 80
405 1858
519 528
931 1535
674 1277
351 634
365 1844
242 1637
1543 1600
714 1054
800 1559
1269 1273
1621 1893
630 1242
698 1147
703 811
1686 1965
580 1202
1188 1206
1664 1922
144 1571
292 1369
433 1919
...

output:

NO
YES
YES
NO
YES
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
YES
YES
NO
NO
YES
YES
NO
YES
NO
NO
YES
NO
YES
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
YES
YES
NO
NO
YES
NO
YES
NO
NO
NO
YES
YES
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
YES
NO
YES
YES
NO
YES
N...

result:

ok 2000 lines

Test #15:

score: 0
Accepted
time: 3ms
memory: 49108kb

input:

2000 2000 2000
659 758
1650 1678
341 818
235 1380
1865 1927
1233 1366
267 1673
775 1698
1022 1255
1110 1533
1854 1928
169 1579
449 729
943 1335
360 583
50 795
926 1584
911 1924
280 604
309 1429
420 1107
1466 1858
76 265
1077 1109
245 622
957 1941
1434 1560
122 1128
51 229
826 925
851 1006
323 1744
8...

output:

YES
NO
NO
YES
NO
NO
YES
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
YES
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
YES
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
YES
NO
NO
NO
N...

result:

ok 2000 lines

Test #16:

score: 0
Accepted
time: 3ms
memory: 49512kb

input:

2000 2000 2000
1687 1697
1764 1766
672 678
485 495
1500 1506
1167 1168
1708 1716
347 353
754 759
616 623
1623 1626
934 943
822 822
1852 1857
559 569
1266 1275
389 396
472 473
144 149
766 769
1868 1869
1194 1201
1913 1921
741 747
153 163
558 558
1908 1913
1861 1862
775 779
1809 1816
816 825
171 180
1...

output:

NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
...

result:

ok 2000 lines

Test #17:

score: 0
Accepted
time: 0ms
memory: 48736kb

input:

2000 2000 2000
1992 2000
647 653
573 575
1484 1494
424 429
1598 1605
1013 1018
1737 1747
1675 1680
1589 1595
860 865
1716 1724
9 10
1451 1460
1385 1391
1347 1351
105 107
1832 1835
327 331
1165 1169
695 697
1047 1051
942 944
190 200
543 552
1895 1899
524 528
1531 1538
986 988
475 480
785 793
1652 166...

output:

NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
...

result:

ok 2000 lines

Test #18:

score: 0
Accepted
time: 1ms
memory: 49628kb

input:

2000 1990 2000
1546 1548
446 448
1806 1808
832 834
1426 1428
1684 1686
961 963
44 46
141 143
289 291
325 327
1874 1876
625 627
527 529
919 921
1927 1929
302 304
707 709
1073 1075
1021 1023
1610 1612
1539 1541
1029 1031
1330 1332
779 781
257 259
1416 1418
1746 1748
340 342
385 387
395 397
550 552
460...

output:

NO
NO
YES
NO
NO
YES
NO
YES
NO
NO
YES
NO
NO
YES
NO
NO
YES
NO
NO
NO
YES
YES
NO
NO
YES
YES
YES
YES
NO
NO
NO
YES
YES
NO
NO
NO
YES
NO
NO
YES
NO
NO
YES
NO
NO
YES
NO
YES
NO
YES
YES
NO
NO
NO
YES
YES
YES
YES
NO
NO
NO
YES
NO
YES
NO
NO
YES
YES
NO
NO
YES
NO
YES
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
YES
YES
NO
YES
YES
...

result:

ok 2000 lines

Test #19:

score: 0
Accepted
time: 9ms
memory: 49244kb

input:

2000 1900 2000
772 800
216 244
358 386
1022 1050
166 194
1638 1666
51 79
898 926
712 740
779 807
1157 1185
1718 1746
232 260
1430 1458
1660 1688
675 703
972 1000
1012 1040
1057 1085
1623 1651
1779 1807
1002 1030
1224 1252
1429 1457
658 686
539 567
1587 1615
1088 1116
259 287
1663 1691
1829 1857
726 ...

output:

YES
YES
YES
YES
YES
NO
NO
NO
NO
YES
NO
YES
NO
NO
YES
NO
NO
NO
NO
YES
YES
YES
YES
YES
YES
NO
NO
YES
NO
NO
YES
NO
NO
YES
NO
NO
NO
YES
YES
YES
NO
YES
YES
NO
NO
NO
NO
NO
NO
YES
YES
YES
YES
YES
NO
NO
NO
NO
YES
YES
NO
YES
YES
NO
NO
NO
YES
YES
NO
NO
YES
YES
YES
YES
NO
YES
YES
NO
YES
NO
YES
NO
YES
NO
NO
NO
...

result:

ok 2000 lines

Subtask #3:

score: 15
Accepted

Dependency #2:

100%
Accepted

Test #20:

score: 15
Accepted
time: 36ms
memory: 50404kb

input:

2000 1000 500000
1604 1997
1183 1279
730 783
558 762
478 1141
763 1772
35 1907
371 1334
494 1017
127 1108
187 1492
703 837
409 1222
1776 1796
1195 1466
1390 1777
106 821
99 873
1127 1891
1451 1982
1847 1968
173 1408
331 1093
301 616
170 1888
1158 1395
27 1632
50 467
25 1519
249 840
654 670
260 1111
...

output:

NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
...

result:

ok 500000 lines

Test #21:

score: 0
Accepted
time: 18ms
memory: 50488kb

input:

2000 10000 500000
1341 1821
329 1867
895 1868
138 887
1360 1756
412 1367
777 1001
71 1630
1587 1816
659 1363
798 1886
816 1793
450 511
1328 1527
1131 1686
560 1903
926 1626
42 804
218 1250
650 801
1820 1854
102 177
387 547
178 554
695 1065
439 692
1585 1915
1544 1893
866 931
247 685
1001 1562
827 14...

output:

NO
YES
YES
YES
YES
YES
YES
NO
YES
YES
YES
YES
NO
YES
NO
NO
NO
NO
YES
NO
YES
YES
YES
YES
NO
NO
NO
NO
NO
YES
NO
YES
YES
YES
NO
YES
YES
YES
YES
YES
YES
YES
YES
NO
YES
YES
NO
YES
YES
YES
NO
YES
NO
YES
YES
NO
YES
NO
YES
YES
YES
YES
YES
YES
NO
YES
YES
NO
YES
YES
NO
NO
YES
NO
YES
NO
YES
NO
NO
YES
YES
NO
YE...

result:

ok 500000 lines

Test #22:

score: 0
Accepted
time: 36ms
memory: 52620kb

input:

2000 100000 500000
968 1817
404 545
310 1458
1367 1418
189 999
850 1561
246 1848
1098 1540
862 1753
11 805
516 999
903 952
575 824
1616 1744
1385 1694
167 1337
367 1117
1329 1651
320 975
983 1138
294 907
48 533
376 1186
866 1507
130 955
525 1761
541 1047
64 783
535 776
1243 1504
699 1371
602 1077
13...

output:

YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
NO
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
Y...

result:

ok 500000 lines

Test #23:

score: 0
Accepted
time: 65ms
memory: 58100kb

input:

2000 500000 500000
920 1943
1138 1274
1537 1876
1308 1779
1563 1673
881 1532
27 430
721 1430
1179 1599
662 1551
344 1179
784 1306
1714 1864
882 1180
716 1711
1762 1856
21 1255
116 1213
841 1315
368 954
153 1861
784 1624
1343 1585
1160 1764
115 1301
949 1481
851 974
108 213
628 1646
263 1941
303 490
...

output:

YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
NO
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
Y...

result:

ok 500000 lines

Test #24:

score: 0
Accepted
time: 49ms
memory: 50208kb

input:

2000 5000 500000
127 1171
764 1227
1099 1762
1824 1926
1114 1295
895 1987
196 1751
813 1652
761 1926
278 715
41 368
204 1710
417 828
1034 1217
1745 1990
969 1130
568 1993
1317 1410
122 948
345 654
712 1279
1600 1754
33 199
1581 1666
1243 1361
719 1650
269 1539
276 1445
58 374
313 358
944 1360
521 69...

output:

NO
YES
NO
YES
YES
YES
YES
NO
NO
NO
YES
YES
YES
YES
YES
NO
YES
YES
YES
YES
NO
YES
NO
YES
NO
NO
YES
YES
YES
NO
YES
YES
NO
YES
NO
YES
YES
NO
NO
YES
YES
NO
NO
YES
YES
YES
YES
YES
YES
YES
YES
NO
YES
YES
YES
YES
YES
YES
YES
NO
YES
NO
NO
YES
NO
YES
NO
YES
YES
YES
NO
YES
NO
NO
NO
YES
YES
YES
NO
YES
YES
YES
...

result:

ok 500000 lines

Test #25:

score: 0
Accepted
time: 64ms
memory: 56436kb

input:

2000 500000 500000
74 178
105 1245
1847 1885
1053 1217
290 1275
1285 1296
418 619
241 308
616 958
169 410
1213 1755
640 1632
728 846
1293 1482
45 1944
1103 1288
589 1341
419 1044
577 662
1498 1672
112 1187
1035 1314
548 1936
960 1763
1072 1692
855 946
407 1165
759 1109
795 995
1645 1656
577 1210
119...

output:

YES
YES
YES
YES
YES
YES
NO
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
NO
YES
YES
YES
YES
YES
YES
YE...

result:

ok 500000 lines

Test #26:

score: 0
Accepted
time: 70ms
memory: 57444kb

input:

2000 500000 500000
631 1336
1461 1597
711 1755
975 1625
442 1083
1730 1766
1046 1238
1565 1986
390 1926
864 1484
954 1326
182 346
1056 1199
1129 1525
25 585
1661 1847
204 719
1062 1506
251 529
594 1054
55 570
644 1462
1013 1696
120 620
388 841
209 1455
1289 1368
741 1099
1117 1470
361 1828
1251 1254...

output:

YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
...

result:

ok 500000 lines

Test #27:

score: 0
Accepted
time: 32ms
memory: 51856kb

input:

2000 5000 500000
1061 1362
1718 1775
1102 1464
1021 1076
325 538
1009 1126
1041 1380
176 650
95 311
914 923
1132 1752
76 269
145 304
152 251
101 745
1372 1442
1547 1710
1740 1788
130 735
105 312
1305 1422
643 793
314 367
663 745
359 619
549 731
1010 1815
1217 1614
240 743
80 317
75 619
414 725
565 8...

output:

YES
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
YES
YES
NO
YES
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
YES
NO
NO
YES
YES
NO
YES
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
YES
NO
NO
YES
YES
YES
NO
NO
NO
YES
NO
NO
YES
NO
YES
NO
NO
NO
NO
YES
NO
YES
YES
YES
YES
YES
NO
NO
NO
NO
NO
NO
YES
YES
YES
NO
YES
YES
YE...

result:

ok 500000 lines

Test #28:

score: 0
Accepted
time: 32ms
memory: 51560kb

input:

2000 5000 500000
1060 1747
307 1148
795 1271
156 1623
723 1303
846 1026
96 650
1630 1787
862 1851
657 886
382 1001
917 1576
261 1619
311 479
820 1367
858 953
1470 1866
1280 1870
556 1967
292 1606
207 1964
1896 1913
1419 1452
1691 1882
1161 1546
848 1283
665 790
642 710
133 1085
818 1857
44 1645
1448...

output:

YES
NO
YES
NO
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
NO
YES
NO
YES
YES
YES
YES
YES
NO
YES
YES
YES
YES
YES
NO
YES
YES
YES
YES
NO
YES
YES
YES
YES
YES
YES
YES
YES
YES
NO
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
NO
NO
YES
NO
YES
NO
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
...

result:

ok 500000 lines

Test #29:

score: 0
Accepted
time: 29ms
memory: 51132kb

input:

2000 50000 500000
954 993
604 1398
1773 1909
393 1744
924 1264
868 1164
1219 1372
1079 1547
506 1390
339 1709
941 1504
1758 1940
75 782
715 864
1514 1738
323 431
745 1920
69 1926
971 1524
267 1138
712 1259
67 584
870 915
1651 1690
1547 1987
703 1093
1073 1241
67 664
277 691
941 1684
199 694
86 1786
...

output:

YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
NO
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
NO
YES
YES
YES
YES
YES
NO
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
NO
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
NO
YES
YES
Y...

result:

ok 500000 lines

Test #30:

score: 0
Accepted
time: 54ms
memory: 58012kb

input:

2000 500000 500000
8 1913
589 1791
474 1943
455 1103
213 266
1087 1878
1054 1247
139 948
1218 1807
1030 1672
1319 1718
232 785
836 1732
1351 1746
1255 1549
940 1001
800 1767
489 975
207 276
523 1051
1764 1899
1498 1730
203 1921
859 1892
1113 1769
761 1184
197 1676
447 848
1424 1603
161 606
417 852
6...

output:

YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
...

result:

ok 500000 lines

Test #31:

score: 0
Accepted
time: 40ms
memory: 52196kb

input:

2000 10000 500000
1599 1606
556 559
833 835
1403 1411
1880 1881
846 853
1768 1773
1169 1178
1093 1101
1124 1134
169 177
1674 1684
913 916
412 415
1408 1415
1956 1960
363 367
1042 1050
1996 1999
1530 1534
1072 1075
644 652
1337 1338
603 613
1996 1998
799 803
1027 1028
1971 1976
508 517
191 194
88 95
...

output:

YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
NO
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
NO
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
NO
YES
YES
YES
YES
YES
YES
YES
YES...

result:

ok 500000 lines

Subtask #4:

score: 0
Runtime Error

Test #32:

score: 20
Accepted
time: 53ms
memory: 52536kb

input:

100000 100000 100000
44237 85021
45776 80409
39632 94735
28119 63770
47399 73347
28902 87358
27924 65499
23898 54817
50114 96633
11325 37690
46642 94643
9271 47594
47324 47948
27957 58134
20443 88720
20834 89483
77577 94705
7835 30030
37387 59648
8364 76478
66145 76025
12683 79475
1745 33181
43966 5...

output:

YES
NO
YES
NO
YES
YES
YES
YES
YES
YES
NO
NO
YES
YES
YES
YES
NO
NO
YES
NO
NO
YES
NO
YES
NO
YES
YES
YES
NO
NO
YES
NO
YES
YES
YES
YES
YES
NO
NO
NO
NO
YES
NO
NO
NO
NO
YES
NO
YES
NO
YES
YES
YES
YES
YES
YES
NO
YES
NO
NO
NO
YES
YES
YES
YES
YES
YES
YES
YES
YES
NO
YES
YES
YES
YES
NO
NO
NO
NO
YES
NO
YES
NO
YE...

result:

ok 100000 lines

Test #33:

score: 0
Accepted
time: 44ms
memory: 53328kb

input:

100000 100000 100000
35741 60377
60963 75253
19797 42601
35753 79403
7502 18877
47102 89341
28014 35036
2734 26925
1088 30541
8270 68412
10391 85525
50950 55103
57533 94509
52355 77010
77860 88590
8709 31105
4292 21010
438 9944
34758 94378
31011 98475
37243 73734
21568 46633
59934 94265
3839 68210
2...

output:

YES
NO
YES
NO
YES
NO
YES
YES
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
YES
NO
NO
YES
YES
NO
NO
NO
NO
YES
NO
NO
YES
YES
YES
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
YES
NO
YES
YES
YES
YES
YES
NO
NO
YES
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
YES
YES
YES
NO
YES
YES
NO
YES
NO
YES
NO
NO
NO
NO
NO
NO
YES
NO
YES
NO
NO
YES
NO
NO
N...

result:

ok 100000 lines

Test #34:

score: 0
Accepted
time: 39ms
memory: 53288kb

input:

100000 100000 100000
18975 18982
81626 81634
78338 78345
51904 51907
21622 21626
9459 9461
83080 83081
60411 60421
34363 34365
33780 33783
93124 93133
65357 65367
37292 37297
55530 55536
5618 5622
24035 24043
11654 11659
17731 17738
23791 23801
16233 16236
7398 7400
57194 57202
537 541
70637 70638
1...

output:

NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
...

result:

ok 100000 lines

Test #35:

score: 0
Accepted
time: 40ms
memory: 52644kb

input:

100000 100000 100000
56780 56781
78108 78113
38474 38474
71772 71772
46509 46509
31045 31052
39368 39377
8043 8043
34076 34081
29173 29175
74381 74381
97949 97952
76876 76880
47094 47103
89482 89482
21332 21335
51072 51072
21495 21498
44772 44774
29483 29492
15061 15071
98370 98375
7980 7989
44782 4...

output:

NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
...

result:

ok 100000 lines

Test #36:

score: 0
Accepted
time: 49ms
memory: 52584kb

input:

100000 100000 100000
13478 13486
66101 66103
29480 29483
67830 67834
44111 44115
74416 74422
18008 18011
23931 23932
34645 34649
69377 69379
18187 18197
7908 7913
27349 27359
75638 75645
47967 47969
10462 10467
7179 7183
90906 90912
17936 17943
29688 29692
91894 91897
38747 38748
85436 85443
52049 5...

output:

NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
...

result:

ok 100000 lines

Test #37:

score: 0
Accepted
time: 56ms
memory: 53836kb

input:

100000 100000 100000
35164 35164
35404 35408
44222 44227
73177 73185
64265 64271
80552 80553
23132 23140
29501 29509
36283 36290
54724 54729
39668 39678
95694 95703
35921 35921
94533 94541
26515 26516
49429 49431
79417 79422
37677 37681
8230 8238
56125 56128
87102 87109
66148 66155
16156 16160
59157...

output:

NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
...

result:

ok 100000 lines

Test #38:

score: -20
Runtime Error

input:

500000 500000 500000
88682 403281
274991 471113
5603 53417
99204 205233
29613 32231
400245 490999
100888 117309
52 4642
11996 165917
214488 475381
264403 381213
65798 375601
5707 203306
31302 110300
347251 490260
338382 376148
191679 232337
111617 135636
140646 479165
86807 475274
244419 453460
1871...

output:


result:


Subtask #5:

score: 36
Accepted

Dependency #3:

100%
Accepted

Test #43:

score: 36
Accepted
time: 18ms
memory: 51112kb

input:

10000 100000 100000
3562 3915
1697 3165
2781 9598
517 7956
67 1645
7917 8056
4531 6982
4378 4914
1640 4541
579 1707
8251 8447
1047 7601
1863 6879
5956 7928
263 1288
2481 9442
300 873
2272 4832
1368 4916
4527 5086
1845 3487
3729 5020
2678 5996
4428 6862
2903 4350
3196 8329
5183 8308
933 2580
7477 882...

output:

YES
YES
YES
YES
NO
YES
YES
YES
NO
YES
YES
YES
NO
YES
NO
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
NO
YES
NO
YES
YES
NO
YES
YES
YES
NO
YES
YES
YES
YES
YES
NO
YES
YES
YES
YES
YES
YES
YES
YES
YES
NO
YES
NO
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
NO
YES
NO
YES
NO
YES
YES
NO
YES...

result:

ok 100000 lines

Test #44:

score: 0
Accepted
time: 27ms
memory: 50364kb

input:

10000 100000 100000
7339 8214
7911 8071
8852 8854
1944 5204
4249 5801
7661 8495
4621 6520
2831 4701
6455 9198
1756 4005
2195 6028
2726 5111
2071 6144
2789 4370
133 5601
1707 7009
6436 8972
1277 9432
2349 4147
1934 2324
2292 9959
3505 5080
6675 7080
969 5968
817 2817
6310 7380
1401 4003
2772 8167
326...

output:

YES
YES
YES
YES
NO
YES
YES
YES
YES
NO
YES
YES
YES
NO
YES
YES
NO
YES
YES
YES
YES
YES
YES
YES
NO
YES
NO
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
NO
YES
YES
YES
YES
YES
NO
YES
YES
YES
NO
NO
YES
YES
YES
NO
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES...

result:

ok 100000 lines

Test #45:

score: 0
Accepted
time: 36ms
memory: 52508kb

input:

100000 100000 100000
44237 85021
45776 80409
39632 94735
28119 63770
47399 73347
28902 87358
27924 65499
23898 54817
50114 96633
11325 37690
46642 94643
9271 47594
47324 47948
27957 58134
20443 88720
20834 89483
77577 94705
7835 30030
37387 59648
8364 76478
66145 76025
12683 79475
1745 33181
43966 5...

output:

NO
YES
YES
NO
NO
NO
YES
YES
YES
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
YES
NO
NO
NO
NO
NO
YES
YES
YES
NO
NO
YES
NO
NO
NO
NO
YES
...

result:

ok 100000 lines

Test #46:

score: 0
Accepted
time: 50ms
memory: 52872kb

input:

100000 100000 100000
35741 60377
60963 75253
19797 42601
35753 79403
7502 18877
47102 89341
28014 35036
2734 26925
1088 30541
8270 68412
10391 85525
50950 55103
57533 94509
52355 77010
77860 88590
8709 31105
4292 21010
438 9944
34758 94378
31011 98475
37243 73734
21568 46633
59934 94265
3839 68210
2...

output:

NO
NO
NO
YES
YES
NO
YES
NO
NO
YES
YES
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
YES
YES
NO
YES
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
YES
NO
YES
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
YES
YE...

result:

ok 100000 lines

Test #47:

score: 0
Accepted
time: 36ms
memory: 55992kb

input:

100000 100000 100000
93586 93586
21201 21201
74030 74030
33721 33721
96949 96949
57198 57198
18644 18644
70558 70558
28646 28646
18879 18879
87911 87911
7538 7538
74952 74952
16991 16991
62128 62128
42117 42117
1269 1269
25086 25086
13985 13985
57474 57474
81948 81948
22274 22274
60623 60623
37830 3...

output:

YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
...

result:

ok 100000 lines

Test #48:

score: 0
Accepted
time: 37ms
memory: 56892kb

input:

100000 99990 100000
1178 1188
3249 3259
15995 16005
54251 54261
71782 71792
5075 5085
18844 18854
82415 82425
24226 24236
16677 16687
80593 80603
37031 37041
16432 16442
56593 56603
8817 8827
22615 22625
35093 35103
46002 46012
54946 54956
74217 74227
9448 9458
69776 69786
67414 67424
83333 83343
51...

output:

YES
YES
NO
YES
YES
YES
YES
YES
YES
YES
YES
NO
YES
NO
YES
YES
NO
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
NO
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
NO
YES
YES
YES
YES
YES
YES
YE...

result:

ok 100000 lines

Test #49:

score: 0
Accepted
time: 28ms
memory: 52948kb

input:

100000 50000 100000
13557 13566
52834 52843
30854 30863
54586 54595
70633 70642
31135 31144
62370 62379
56076 56085
50467 50476
71848 71857
57670 57679
641 650
85558 85567
49309 49318
63965 63974
35500 35509
82586 82595
65309 65318
74039 74048
71293 71302
29123 29132
39985 39994
45817 45826
27309 27...

output:

NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
...

result:

ok 100000 lines

Test #50:

score: 0
Accepted
time: 24ms
memory: 54456kb

input:

100000 90000 100000
83216 83216
3471 3471
57096 57096
97590 97590
58482 58482
82530 82530
56014 56014
91081 91081
97541 97541
97030 97030
49397 49397
47820 47820
89195 89195
12713 12713
28901 28901
33818 33818
7064 7064
1 1
90856 90856
4664 4664
1152 1152
21281 21281
26744 26744
73040 73040
90294 90...

output:

NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
...

result:

ok 100000 lines

Test #51:

score: 0
Accepted
time: 41ms
memory: 52260kb

input:

100000 100000 100000
15532 93326
42780 86551
74968 94068
47781 50491
23430 56380
2243 35896
64036 77079
29126 63337
36482 55032
58019 61818
60675 69313
18629 74557
45343 66736
15840 63135
63838 94826
12437 23587
41596 68729
14069 26009
48174 69956
57220 99500
77132 78312
22734 47417
30397 47909
2546...

output:

NO
NO
YES
NO
NO
YES
NO
NO
NO
NO
YES
NO
NO
NO
YES
YES
NO
YES
NO
NO
NO
NO
YES
NO
YES
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
YES
YES
NO
YES
NO
NO
NO
NO
NO
YES
YES
NO
YES
NO
NO
YES
YES
YES
YES
YES
YES
NO
NO
NO
NO
YES
NO
NO
NO
NO
YES
NO
NO
NO
YES
NO
NO
YES
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
N...

result:

ok 100000 lines

Test #52:

score: 0
Accepted
time: 53ms
memory: 52360kb

input:

100000 100000 100000
7040 33528
37216 91315
24531 29745
22320 51322
8655 55232
1419 93619
76842 84164
13287 60443
68535 93555
40385 91241
53767 87980
18990 55466
7829 78578
34214 80666
32315 61095
46203 95053
15765 87652
28416 33024
28179 46558
12325 63221
16304 90160
49890 54356
33704 63521
43557 7...

output:

NO
YES
NO
NO
NO
NO
NO
NO
YES
YES
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
YES
YES
NO
YES
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
YES
NO
NO
YES
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
YES
NO
YES
YE...

result:

ok 100000 lines

Test #53:

score: 0
Accepted
time: 52ms
memory: 54824kb

input:

100000 100000 100000
33945 77125
42133 84462
20854 99959
5851 5854
55361 55363
81533 81534
24858 42634
8850 47761
17299 17300
57315 57319
72557 72561
20048 32762
56132 56133
55299 55304
2243 35725
37514 37515
65357 72747
68886 68888
65797 65798
46089 48084
4618 4988
47493 47494
6407 87083
11611 1161...

output:

YES
NO
NO
YES
NO
YES
NO
YES
YES
YES
YES
NO
NO
YES
YES
YES
NO
YES
NO
YES
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
YES
NO
NO
YES
NO
NO
NO
YES
YES
NO
YES
NO
NO
YES
NO
NO
YES
YES
NO
NO
NO
YES
NO
YES
NO
NO
YES
YES
NO
NO
YES
YES
NO
YES
YES
YES
YES
YES
YES
NO
YES
NO
NO
NO
YES
NO
NO
YES
YES
NO
YES
YES
NO
YE...

result:

ok 100000 lines

Test #54:

score: 0
Accepted
time: 59ms
memory: 55968kb

input:

100000 100000 100000
9713 9714
4911 58294
96432 96433
58485 58488
39741 39743
44707 84228
18527 51326
17968 17971
47038 92504
67416 67417
82829 82832
47897 93109
79753 79755
76865 92280
68098 78590
49417 49418
47846 47847
13515 13518
1442 1447
58792 58793
41810 41812
18434 18435
73070 73071
67353 67...

output:

YES
NO
YES
NO
NO
YES
YES
NO
NO
YES
YES
NO
NO
NO
YES
NO
NO
NO
YES
NO
NO
YES
YES
NO
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
NO
YES
YES
YES
YES
NO
NO
NO
YES
YES
YES
NO
NO
NO
YES
YES
YES
NO
YES
NO
YES
YES
YES
YES
NO
NO
NO
YES
YES
NO
YES
YES
NO
YES
YES
YES
NO
YES
NO
NO
NO
YES
YES
YES
YES
NO
NO
YES
YE...

result:

ok 100000 lines

Test #55:

score: 0
Accepted
time: 47ms
memory: 52780kb

input:

100000 100000 100000
76685 76945
68666 76540
79814 95813
28466 33346
10680 30779
23723 30381
70608 87406
92465 98969
20558 47953
4528 58804
69414 73644
70901 91641
6942 57701
6490 28782
61938 65292
1223 21017
85931 88968
11641 47022
71189 86575
16991 30927
50992 55043
84683 90065
48240 51221
81084 8...

output:

YES
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
YES
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
YES
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
YES
NO
NO
NO
YES
YES
NO
YES
NO
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
NO
YES
NO
YES
YES
NO
NO
YES
NO
NO
NO
NO
YES
YES
YES
YES
NO
YES
NO
NO
NO
NO
...

result:

ok 100000 lines

Test #56:

score: 0
Accepted
time: 43ms
memory: 52792kb

input:

100000 100000 100000
44544 67190
3000 14298
30676 95163
2025 11523
32716 56628
6438 19399
22076 22085
30644 50904
5601 9268
7290 9303
25673 25682
69435 72324
8689 14557
1906 16760
4956 19753
29182 29191
15291 15490
31758 87405
1908 8366
43297 91065
44412 97631
8894 8960
2476 7899
14360 19622
816 139...

output:

NO
NO
NO
NO
NO
NO
YES
YES
YES
YES
YES
NO
NO
NO
NO
NO
YES
NO
NO
YES
YES
NO
YES
NO
YES
YES
YES
NO
YES
NO
YES
YES
NO
YES
NO
NO
NO
NO
NO
NO
YES
NO
NO
YES
NO
YES
NO
NO
NO
YES
NO
NO
NO
NO
NO
NO
YES
YES
NO
YES
NO
NO
YES
NO
YES
NO
YES
YES
NO
YES
NO
YES
NO
NO
YES
YES
NO
NO
YES
NO
NO
NO
YES
YES
NO
NO
NO
NO
NO...

result:

ok 100000 lines

Test #57:

score: 0
Accepted
time: 35ms
memory: 54508kb

input:

100000 100000 100000
3246 4472
755 6552
57327 79055
19044 19045
2939 5659
56448 64380
3778 5102
9864 9865
13809 13810
1860 3636
185 6664
1731 4066
44792 44793
5379 6434
72234 89744
88377 97059
421 4808
82126 84274
22197 22198
30229 30230
62285 93170
17855 17856
1538 6144
3699 4446
207 1640
52967 973...

output:

NO
YES
NO
NO
NO
YES
YES
NO
NO
YES
YES
YES
NO
NO
YES
YES
YES
NO
NO
NO
NO
NO
NO
YES
YES
NO
NO
YES
YES
YES
NO
NO
YES
YES
YES
NO
YES
NO
NO
YES
YES
YES
NO
NO
YES
NO
YES
NO
NO
NO
NO
YES
YES
YES
NO
NO
YES
NO
YES
NO
NO
NO
NO
NO
NO
YES
YES
NO
NO
YES
YES
NO
NO
YES
NO
YES
NO
YES
YES
NO
NO
NO
YES
NO
YES
NO
NO
Y...

result:

ok 100000 lines

Subtask #6:

score: 0
Skipped

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Dependency #4:

0%