QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#647947#6392. CurtainsFloze3100 ✓751ms36896kbC++177.8kb2024-10-17 16:18:482024-10-17 16:18:48

Judging History

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

  • [2024-10-17 16:18:48]
  • 评测
  • 测评结果:100
  • 用时:751ms
  • 内存:36896kb
  • [2024-10-17 16:18:48]
  • 提交

answer

/*
 * @Author: Floze3
 * @Date: 2024-10-17 16:07:56
 * @LastEditors: Floze3 [email protected]
 * @LastEditTime: 2024-10-17 16:16:56
 * @FilePath: /dmy/17/C.cpp
 * @Description: Coding
 * Never Be Alone
 */
#include <bits/stdc++.h>
#define mp(x, y) std::make_pair(x, y)
#define mt std::make_tuple
#define eb emplace_back
#define fi first
#define se second
#define all(s) s.begin(), s.end()
#define rall(x) s.rbegin(), s.rend()
#define file(name)                 \
  freopen(name ".in", "r", stdin); \
  freopen(name ".out", "w", stdout);
#define fs(x) std::fixed << std::setprecision(x)
#define lowbit(x) (x & -x)
#define il inline
#define Avada_Kedavra return 0
#define _IOS                        \
  std::ios::sync_with_stdio(false); \
  std::cin.tie(nullptr), std::cout.tie(nullptr)
#define RANDOM_SEED std::chrono::steady_clock::now().time_since_epoch().count()
#define popcount __builtin_popcount
#define popcountll __builtin_popcountll
#define multitask    \
  int _; io.read(_); \
  while (_--)

namespace TYPEDEF {

using i64 = long long;
using u64 = unsigned long long;
using u32 = unsigned int;
using i128 = __int128;
using pii = std::pair<int, int>;
using pi64 = std::pair<i64, i64>;
using vi = std::vector<int>;
using vi64 = std::vector<i64>;
using vu64 = std::vector<u64>;
using vpii = std::vector<pii>;
using vpi64 = std::vector<pi64>;
using si = std::stack<int>;
using si64 = std::stack<i64>;
using su64 = std::stack<u64>;
using spii = std::stack<pii>;
using spi64 = std::stack<pi64>;
using qi = std::queue<int>;
using qi64 = std::queue<i64>;
using qu64 = std::queue<u64>;
using qpii = std::queue<pii>;
using qpi64 = std::queue<pi64>;
using siset = std::set<int>;
using si64set = std::set<i64>;
using su64set = std::set<u64>;
using spiiset = std::set<pii>;
using spi64set = std::set<pi64>;
using str = std::string;
using vstr = std::vector<str>;
using f64 = long double;

} // namespaec TYPEDEF

using namespace TYPEDEF;

struct IO {
  #define MAXSIZE (1 << 20)
  #define isdigit(x) (x >= '0' && x <= '9')
  char buf[MAXSIZE], *p1, *p2, pbuf[MAXSIZE], *pp;
#ifndef ONLINE_JUDGE  // 调试,可显示字符
#else
  IO() : p1(buf), p2(buf), pp(pbuf) {}
  ~IO() { fwrite(pbuf, 1, pp - pbuf, stdout); }
#endif
  char gc() {
#ifndef ONLINE_JUDGE  // 调试,可显示字符
    return getchar();
#endif
    if (p1 == p2) p2 = (p1 = buf) + fread(buf, 1, MAXSIZE, stdin);
    return p1 == p2 ? ' ' : *p1++;
  }
  il bool blank(char ch) { return ch == ' ' || ch == '\n' || ch == '\r' || ch == '\t'; }
  template <typename T> il void read(T &x) {
    double tmp = 1; bool sign = 0; x = 0;
    char ch = gc();
    for (; !isdigit(ch); ch = gc()) if (ch == '-') sign = 1;
    for (; isdigit(ch); ch = gc()) x = x * 10 + (ch - '0');
    if (ch == '.')
      for (ch = gc(); isdigit(ch); ch = gc()) tmp /= 10.0, x += tmp * (ch - '0');
    if (sign) x = -x;
  }
  il void read(char *s) {
    char ch = gc();
    for (; blank(ch); ch = gc());
    for (; !blank(ch); ch = gc()) *s++ = ch;
    *s = 0;
  }
  il void read(char &c) { for (c = gc(); blank(c); c = gc()); }
  il void read(str &s) {
    s.clear(); char ch = gc();
    for (; blank(ch); ch = gc());
    for (; !blank(ch); ch = gc()) s += ch;
  }
  template<typename T, typename... Args> il void read(T &x, Args&... args) { read(x), read(args...); }
  il void push(const char &c) {
#ifndef ONLINE_JUDGE  // 调试,可显示字符
    putchar(c);
#else
    if (pp - pbuf == MAXSIZE) fwrite(pbuf, 1, MAXSIZE, stdout), pp = pbuf;
    *pp++ = c;
#endif
  }
  template <typename T> il void write(T x) {
    if (x < 0) x = -x, push('-');  // 负数输出
    static int sta[40];
    int top = 0;
    do sta[top++] = x % 10, x /= 10; while (x);
    while (top) push(sta[--top] + '0');
  }
  il void write(double x, int k = 6) {
    if (x < 0) x = -x, push('-');  // 负数输出
    static int sta[40];
    int n = pow(10, k), top = 0;
    i64 nx = (i64)x, y = i64(x * n) % n;
    write(nx, '.');
    for (int i = 0; i < k; i++) sta[++top] = y % 10, y /= 10;
    while (top) push(sta[top--] + '0');
  }
  il void write(char *s) { while (*s) push(*s++); }
  il void write(const char *s) { while (*s) push(*s++); }
  il void write(char c) { push(c); }
  il void write(str s) { for (int c : s) push(c); }
  template<typename T, typename... Args> il void write(T x, Args... args) { write(x), write(args...); }
} io;

/*============================DEBUG_AREA============================*/

namespace DDDEBUG {

using std::cerr;
std::ostream &operator<<(std::ostream &os, i128 x) {
  str s; i64 tmp = x;
  while (x) s += '0' + x % 10, x /= 10;
  std::reverse(all(s));
  if (tmp < 0) s = '-' + s;
  return os << s;
}
template<typename X, typename Y>
std::ostream &operator<<(std::ostream &os, std::pair<X, Y> p) {
  return os << '(' << p.fi << ", " << p.se << ")";
}
#ifndef ONLINE_JUDGE
#define debug(x) \
  cerr << "In Line " << __LINE__ << ": " << #x << " = " << x << std::endl
#define look_time cerr << clock() * 1e3 / CLOCKS_PER_SEC << " ms\n"
#define look_memory cerr << fabs(&med - &mst) / 1024.0 / 1024.0 << " mb\n"
#else
#define debug(...) 42
#define look_time 42
#define look_memory 42
#endif

}  // namespace DDDEBUG

using namespace DDDEBUG;

/*================================END================================*/

/*===============================ALGOS===============================*/

namespace basic_algorithm {
template <typename T> il T abs(T a) { return a >= 0 ? a : -a; }
template <typename T> il void chmin(T &a, T b) { if (a > b) a = b; }
template <typename T> il void chmax(T &a, T b) { if (a < b) a = b; }
}  // namespace basic_algorithm

using namespace basic_algorithm;

/*================================END================================*/

constexpr int N = 5e5 + 5;
constexpr int mod = 1e9 + 7;
constexpr int inf = 0x3f3f3f3f;
constexpr i64 inf64 = 0x3f3f3f3f3f3f3f3fll;

std::mt19937 rng(RANDOM_SEED);

bool mst;

int n, m, q;
bool ans[N];

struct line {
  int l, r, id;

  bool operator < (const line &rhs) const {
    return r ^ rhs.r ? r < rhs.r : id < rhs.id;
  }
} a[N + N];

struct node {
  int l, r, tag, mi;

  #define ls (p << 1)
  #define rs (ls | 1)
  #define mid ((t[p].l + t[p].r) >> 1)
} t[N << 2];

il void pushup(int p) { t[p].mi = std::min(t[ls].mi, t[rs].mi); }

il void pushdown(int p) {
  if (~t[p].tag) {
    chmax(t[ls].tag, t[p].tag), chmax(t[rs].tag, t[p].tag);
    chmax(t[ls].mi, t[p].tag), chmax(t[rs].mi, t[p].tag);
    t[p].tag = -1;
  }
  return ;
}

void build(int p, int l, int r) {
  t[p].l = l, t[p].r = r, t[p].tag = -1, t[p].mi = 0;
  if (l == r) return ;
  build(ls, l, mid), build(rs, mid + 1, r);
  return ;
}

void update(int p, int l, int r, int v) {
  if (t[p].l >= l && t[p].r <= r) {
    chmax(t[p].mi, v), chmax(t[p].tag, v);
    return ;
  }
  pushdown(p);
  if (l <= mid) update(ls, l, r, v);
  if (r > mid) update(rs, l, r, v);
  return pushup(p);
}

int query(int p, int l, int r) {
  if (t[p].l >= l && t[p].r <= r) return t[p].mi;
  pushdown(p);
  int res = inf;
  if (l <= mid) chmin(res, query(ls, l, r));
  if (r > mid) chmin(res, query(rs, l, r));
  return res;
}

bool med;

signed main() {
  io.read(n, m, q);
  for (int i = 1; i <= m; ++i) {
    io.read(a[i].l, a[i].r), a[i].id = 0;
  }
  for (int i = 1; i <= q; ++i) {
    io.read(a[i + m].l, a[i + m].r), a[i + m].id = i;
  }
  std::sort(a + 1, a + 1 + m + q);
  build(1, 1, n);
  for (int i = 1; i <= m + q; ++i) {
    if (!a[i].id) update(1, a[i].l, a[i].r, a[i].l);
    else {
      int res = query(1, a[i].l, a[i].r);
      ans[a[i].id] = res >= a[i].l;
    }
  }
  for (int i = 1; i <= q; ++i) io.write(ans[i] ? "YES\n" : "NO\n");
  Avada_Kedavra;
}

/*
all the things you do
the words you say
it all comes back to you
*/

詳細信息

Subtask #1:

score: 3
Accepted

Test #1:

score: 3
Accepted
time: 2ms
memory: 7664kb

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: 3
Accepted
time: 0ms
memory: 9836kb

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: 3
Accepted
time: 2ms
memory: 9764kb

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: 3
Accepted
time: 0ms
memory: 9764kb

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: 3
Accepted
time: 1ms
memory: 7652kb

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: 3
Accepted
time: 2ms
memory: 7692kb

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: 3
Accepted
time: 2ms
memory: 9768kb

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: 3
Accepted
time: 0ms
memory: 9828kb

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: 3
Accepted
time: 0ms
memory: 7660kb

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: 3
Accepted
time: 1ms
memory: 7788kb

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: 0ms
memory: 9764kb

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: 6
Accepted
time: 3ms
memory: 7844kb

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: 6
Accepted
time: 3ms
memory: 7844kb

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: 6
Accepted
time: 3ms
memory: 7848kb

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: 6
Accepted
time: 2ms
memory: 7764kb

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: 6
Accepted
time: 2ms
memory: 7784kb

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: 6
Accepted
time: 2ms
memory: 9884kb

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: 6
Accepted
time: 2ms
memory: 8032kb

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: 6
Accepted
time: 0ms
memory: 9876kb

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: 134ms
memory: 15792kb

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: 15
Accepted
time: 146ms
memory: 15844kb

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: 15
Accepted
time: 178ms
memory: 14564kb

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: 15
Accepted
time: 305ms
memory: 19284kb

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: 15
Accepted
time: 148ms
memory: 15548kb

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: 15
Accepted
time: 305ms
memory: 18952kb

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: 15
Accepted
time: 331ms
memory: 19096kb

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: 15
Accepted
time: 128ms
memory: 18340kb

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: 15
Accepted
time: 80ms
memory: 14748kb

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: 15
Accepted
time: 106ms
memory: 15072kb

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: 15
Accepted
time: 244ms
memory: 18472kb

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: 15
Accepted
time: 87ms
memory: 15080kb

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: 20
Accepted

Test #32:

score: 20
Accepted
time: 82ms
memory: 16052kb

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: 20
Accepted
time: 81ms
memory: 16312kb

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: 20
Accepted
time: 49ms
memory: 15568kb

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: 20
Accepted
time: 54ms
memory: 17912kb

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: 20
Accepted
time: 49ms
memory: 15588kb

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: 20
Accepted
time: 50ms
memory: 15864kb

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
Accepted
time: 542ms
memory: 36896kb

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:

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

result:

ok 500000 lines

Test #39:

score: 20
Accepted
time: 549ms
memory: 36860kb

input:

500000 500000 500000
204810 419422
251667 437173
32193 354856
9920 283192
333795 466386
235797 284143
176786 219551
166453 447969
259718 413475
112506 272325
187989 444962
206011 249984
82571 348619
180355 204521
114417 480380
162226 357608
74629 135111
161937 449322
338017 346599
62512 376917
13834...

output:

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

result:

ok 500000 lines

Test #40:

score: 20
Accepted
time: 290ms
memory: 36712kb

input:

500000 500000 500000
390239 390243
392690 392699
75406 75411
37104 37108
159174 159179
202000 202004
37441 37443
67196 67196
142641 142643
362951 362960
113852 113858
425802 425808
356011 356018
238911 238919
10572 10573
326437 326447
446222 446227
76031 76039
228180 228189
393618 393628
476528 4765...

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 500000 lines

Test #41:

score: 20
Accepted
time: 294ms
memory: 36824kb

input:

500000 500000 500000
491046 491052
213632 213636
277565 277574
202967 202971
253769 253778
328625 328635
39595 39595
437770 437770
286587 286596
390881 390890
49876 49879
363237 363246
430010 430010
467929 467938
209359 209361
326440 326442
28227 28228
294018 294024
218576 218581
364998 365006
49824...

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 500000 lines

Test #42:

score: 20
Accepted
time: 301ms
memory: 36828kb

input:

500000 500000 500000
258441 258443
488078 488082
220685 220686
118795 118804
357929 357934
147861 147867
127676 127677
103011 103019
108726 108727
17921 17923
180414 180415
270589 270591
269265 269273
372633 372633
115213 115216
279441 279446
415635 415642
148242 148250
351887 351891
172449 172452
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 500000 lines

Subtask #5:

score: 36
Accepted

Dependency #3:

100%
Accepted

Test #43:

score: 36
Accepted
time: 80ms
memory: 14216kb

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: 36
Accepted
time: 76ms
memory: 11136kb

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: 36
Accepted
time: 112ms
memory: 16112kb

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: 36
Accepted
time: 111ms
memory: 15588kb

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: 36
Accepted
time: 66ms
memory: 15956kb

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: 36
Accepted
time: 69ms
memory: 16380kb

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: 36
Accepted
time: 56ms
memory: 15684kb

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: 36
Accepted
time: 63ms
memory: 15760kb

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: 36
Accepted
time: 113ms
memory: 16200kb

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: 36
Accepted
time: 109ms
memory: 15888kb

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: 36
Accepted
time: 87ms
memory: 15696kb

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: 36
Accepted
time: 77ms
memory: 17948kb

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: 36
Accepted
time: 94ms
memory: 15876kb

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: 36
Accepted
time: 93ms
memory: 15900kb

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: 36
Accepted
time: 79ms
memory: 15724kb

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: 20
Accepted

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Dependency #4:

100%
Accepted

Dependency #5:

100%
Accepted

Test #58:

score: 20
Accepted
time: 719ms
memory: 34948kb

input:

500000 500000 500000
392988 464822
222469 268285
166494 324446
79694 155141
232080 370529
161535 475768
81689 131475
133337 321926
252807 498954
208146 457199
167326 344238
17602 200986
53779 333659
64610 70326
148803 426033
85060 396257
53971 296941
101012 216421
113348 215867
118165 330525
222334 ...

output:

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

result:

ok 500000 lines

Test #59:

score: 20
Accepted
time: 751ms
memory: 35020kb

input:

500000 500000 500000
294705 369510
38249 149025
397843 432515
190604 322013
352968 371093
136282 194343
130627 179898
6671 7379
84809 342596
26624 248620
44469 296601
257519 407027
130850 226438
34722 267470
372317 375055
128591 251612
46833 121216
51172 71083
109992 431088
108591 224240
254553 4139...

output:

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

result:

ok 500000 lines

Test #60:

score: 20
Accepted
time: 470ms
memory: 36824kb

input:

500000 500000 500000
147988 147988
41728 41728
69377 69377
50432 50432
81930 81930
145797 145797
113431 113431
92955 92955
118700 118700
378451 378451
274175 274175
51925 51925
403434 403434
406354 406354
174601 174601
139683 139683
279397 279397
214480 214480
188132 188132
288952 288952
110638 1106...

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 #61:

score: 20
Accepted
time: 472ms
memory: 36872kb

input:

500000 499990 500000
254537 254547
388878 388888
398577 398587
199473 199483
416000 416010
122284 122294
43432 43442
70711 70721
169422 169432
405415 405425
132681 132691
496530 496540
271923 271933
20313 20323
215725 215735
104438 104448
411960 411970
280324 280334
59200 59210
144187 144197
96806 9...

output:

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
NO
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
NO
YES
YES
YES
...

result:

ok 500000 lines

Test #62:

score: 20
Accepted
time: 449ms
memory: 34420kb

input:

500000 450000 500000
308337 308346
249235 249244
355073 355082
314326 314335
104113 104122
309519 309528
112507 112516
251500 251509
120792 120801
530 539
225499 225508
241403 241412
493127 493136
141479 141488
42 51
480674 480683
159898 159907
410736 410745
163218 163227
211081 211090
284081 284090...

output:

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

result:

ok 500000 lines

Test #63:

score: 20
Accepted
time: 469ms
memory: 36824kb

input:

500000 490000 500000
144079 144079
398312 398312
236569 236569
334216 334216
482875 482875
159346 159346
257740 257740
1440 1440
310358 310358
442439 442439
226197 226197
280898 280898
349796 349796
80002 80002
12663 12663
406758 406758
63591 63591
474040 474040
474790 474790
248924 248924
178026 17...

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 500000 lines

Test #64:

score: 20
Accepted
time: 739ms
memory: 36288kb

input:

500000 500000 500000
306496 462908
282744 314821
97128 334563
49132 480127
71208 281440
30231 55578
22166 221734
5106 305952
159070 202742
174142 405447
2496 383925
39321 116132
75975 297839
61238 261350
138882 274044
200288 403778
340638 431010
35625 41793
453370 463558
165810 168169
406197 479537
...

output:

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

result:

ok 500000 lines

Test #65:

score: 20
Accepted
time: 746ms
memory: 36824kb

input:

500000 500000 500000
269311 475048
154278 455873
291940 499273
70293 179432
344239 360762
33335 204776
194645 225615
91759 439696
187146 319106
661 457242
138264 214310
347768 406595
397539 400632
367741 447960
262626 290384
245533 405258
391721 418636
288451 342665
118968 169578
122914 333635
28802...

output:

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

result:

ok 500000 lines

Test #66:

score: 20
Accepted
time: 610ms
memory: 36888kb

input:

500000 500000 500000
163662 316050
351250 364910
108494 213114
173297 307671
17397 151908
238430 238433
265467 332902
199688 199689
2692 2693
12167 381025
421282 480409
418139 418142
443149 443153
132584 249665
43825 273602
130397 130400
19631 180317
25901 311326
80750 164812
462010 462013
8240 4455...

output:

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

result:

ok 500000 lines

Test #67:

score: 20
Accepted
time: 613ms
memory: 36776kb

input:

500000 500000 500000
11099 11203
7018 81719
183294 451608
33029 114743
184946 449053
39701 88008
67250 98298
61396 92941
207501 462759
30206 50883
57729 94222
179223 215230
416244 431366
101411 105716
54970 70325
360072 407441
44123 48676
141128 263870
23962 55660
357493 470799
322813 379159
401716 ...

output:

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

result:

ok 500000 lines

Test #68:

score: 20
Accepted
time: 608ms
memory: 36764kb

input:

500000 500000 500000
342243 385116
70726 70734
18970 31401
4129 34872
56066 56074
1394 37992
3013 33917
287048 408577
2018 24712
198293 492421
34018 34390
206116 478451
23628 27951
238180 440829
40100 41408
52120 52128
274728 402407
153291 324776
46324 46332
47301 47309
232877 463773
260542 453643
8...

output:

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

result:

ok 500000 lines

Test #69:

score: 20
Accepted
time: 485ms
memory: 36828kb

input:

500000 500000 500000
4495 11417
417556 417557
169024 169025
137744 137745
53057 53058
379042 379043
5381 29304
78606 78607
239378 239379
353882 353883
51482 51483
2594 22161
242644 242645
234453 234454
442513 465558
224110 224111
231394 231395
278564 278565
258518 258519
169898 169899
364905 364906
...

output:

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

result:

ok 500000 lines

Extra Test:

score: 0
Extra Test Passed