QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#425444#7277. Bring Down the Sky Grading ServerLynkcat100 ✓3362ms53800kbC++204.3kb2024-05-30 11:08:212024-05-30 11:08:22

Judging History

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

  • [2024-05-30 11:08:22]
  • 评测
  • 测评结果:100
  • 用时:3362ms
  • 内存:53800kb
  • [2024-05-30 11:08:21]
  • 提交

answer

#include<bits/stdc++.h>
#define poly vector<int>
#define IOS ios::sync_with_stdio(false)
#define ll long long
#define mp make_pair
#define mt make_tuple
#define pa pair < int,int >
#define fi first
#define se second
#define inf 1e18
#define mod 998244353
#define sz(x) ((int)((x).size()))
#define int ll
// #define N 
using namespace std;
int S,Q;
map<tuple<int,int,int,int>,bool>Mp;
map<tuple<int,int,int>,int>Mx;
int tot=0;
inline int dfs(int x,int y,int a,int b);
inline int calc(int Y,int y,int b)
{
    if (Mx.count({Y,y,b})) return Mx[{Y,y,b}];
    int a=Y+y*S;
    int l=1,r=1e12;
    int &res=Mx[{Y,y,b}];
    res=1e13;
    // cout<<"calc "<<Y<<" "<<y<<" "<<b<<": "<<tot<<endl;
    while (l<=r)
    {
        int x=l+(r-l)/2;
        int nw=0;
        {
            if (b)
            {
                int tt=1;
                if (b&&y) tt&=dfs(x,y-1,a,b-1);
                if (b&&a-y*S>0) tt&=dfs(x-(a-y*S),y,a,b-1);
                nw|=tt;
            }
        }
        {
            if (a-(x-b*S)<=0) nw=1;
            if (x-b*S>0)
            {
                int tt=1;
                if (x-b*S>0&&y) tt&=dfs(x,y-1,a-(x-b*S),b);
                if (x-b*S>0&&(a-(x-b*S))-y*S>0) tt&=dfs(x-((a-(x-b*S))-y*S),y,a-(x-b*S),b);
                nw|=tt;
            }
        }
        if (nw) 
        {
            res=x;
            r=x-1;
        } else l=x+1;
    }
    // cout<<"calc finish "<<Y<<" "<<y<<" "<<b<<" "<<res<<": "<<tot<<endl;
    return res;
}
inline int dfs(int x,int y,int a,int b)
{
    ++tot;
    if (x<=0) return 0;
    if (a<=0) return 1;
    if (x<=1ll*b*S&&a<=1ll*y*S)
    {
        ll t=min(-x+1ll*b*S,-a+1ll*y*S)/S+1;
        b-=t,y-=t;
    }
    if (x<=1ll*b*S && a-1ll*y*S>=S) return 0;
    if (x-1ll*b*S>=S&&a-1ll*y*S<=S) return 1;
    if (x<=1ll*b*S&&y==0)
    {
        ll t=(-x+1ll*b*S)/(S-1ll*(a-1ll*y*S))+1;
        if (1ll*(a-1ll*y*S)*t>=x) return 0;
        x+=t*(-1ll*(a-1ll*y*S));
        b-=t;
    }
    if (b==0&&a-1ll*y*S<=0)
    {
        int t=min((a+x-1)/x,(y*S-a)/S+1);
        a-=t*x;
        if (a<=0) return 1;
        y-=t;
    }
    ll X=x-1ll*b*S;
    ll Y=a-1ll*y*S;
    if (x<=1ll*b*S||b>0&&a-1ll*y*S<=0) 
    {
        return dfs(a,b-1,x,y)^1;
    }
    if (a-1ll*y*S>=S||b==0) 
    { 
        return dfs(a-x+1ll*b*S,b,x,y)^1;
    }
    if ((__int128)(S-Y)*b>=(S-X)) return 1;
    if ((__int128)X*(y+1)<=S*y-S+Y) 
    {
        int t=(S*y-S+Y-(X*(y+1)));
        t=t/((S-Y)*(y+1));
        t=min(t,b);
        b-=t;
        X+=t*(S-Y);
        x=X+b*S;
    }
    if (a-1ll*y*S>=S||b==0) 
    { 
        return dfs(a-x+1ll*b*S,b,x,y)^1;
    }
    if ((__int128)(S-X)*y+Y-X>=S) 
        return dfs(a,b-1,x,y)^1;

    __int128 nw=(S-Y);
    if (nw>2*S) return 1;
    if (nw*y>2*S) return 1;if (y) nw*=y;
    if (nw*(b/2)>2*S) return 1;nw*=(b/2);
    if (nw*(b-b/2)>2*S) return 1;nw*=(b-b/2);

    if (x>=calc(Y,y,b)) return 1;
    return 0;

    // if (Mx.count({Y,y,b}))
    // {
    //     if (x<=Mx[{Y,y,b}]) return 0;
    // }
    // if (Mn.count({Y,y,b}))
    // {
    //     if (x>=Mn[{Y,y,b}]) return 1;
    // }
    bool res;
    res=0;
    if (x>1ll*b*S)
    {
        res=dfs(a-x+1ll*b*S,b,x,y)^1;
    }
    // cerr<<"?"<<Y<<" "<<y<<" "<<b<<" "<<x<<" "<<res<<" "<<a-x+b*S<<" "<<b<<" "<<x<<" "<<y<<" "<<(dfs(a-x+1ll*b*S,b,x,y)^1)<<endl;
    if (b>0)
    {
        if (!res) 
            res=dfs(a,b-1,x,y)^1;
    }
    // if (res==1) Mn[{Y,y,b}]=x;
    // else Mx[{Y,y,b}]=x;
    // cerr<<"?"<<Y<<" "<<y<<" "<<b<<" "<<x<<" "<<res<<endl;
    return res;
}
mt19937_64 rnd(time(0));
const int B=1000000000000;
int ans[1000005];
void BellaKira()
{
    cin>>S>>Q;
    int mx=0;
    vector<tuple<int,int,int,int,int>>all;
    for (int i=1;i<=Q;i++)
    {
        int x,y,a,b;
        x=rnd()%B+1,y=rnd()%B+1,a=rnd()%B+1,b=rnd()%B+1;
        cin>>x>>y>>a>>b;
        int lst=tot;
        if (dfs(x,y,a,b)) cout<<"YES\n";
        else cout<<"NO\n";
        // if (tot-lst==60058) cerr<<"??"<<x<<" "<<y<<" "<<a<<" "<<b<<endl;
        if (i%1000==0) cerr<<i<<" "<<sz(Mx)<<" "<<tot<<endl;
    }
}
signed main()
{
    IOS;
    cin.tie(0);
    int T=1;
    while (T--)
    {
        BellaKira();
    }
}
/*list:
1.mod 998244353 or 1e9+7 or ???
2.N
3.duipai shuju xingtai duoyidian
...
*/

詳細信息

Subtask #1:

score: 5
Accepted

Test #1:

score: 5
Accepted
time: 1ms
memory: 3748kb

input:

17 2
42 1 33 1
42 1 33 7

output:

YES
NO

result:

ok 2 token(s): yes count is 1, no count is 1

Test #2:

score: 5
Accepted
time: 49ms
memory: 3756kb

input:

2 250000
75 16 56 55
50 9 49 60
18 67 62 5
30 54 61 39
22 39 42 31
26 30 55 1
23 30 53 16
55 13 6 44
69 8 58 72
53 7 60 12
29 14 26 34
37 64 24 71
19 3 40 1
64 13 33 65
67 24 68 3
64 17 50 66
71 6 62 13
15 29 26 24
51 30 34 45
46 5 40 72
54 52 60 49
35 21 18 30
39 31 35 34
30 74 72 5
74 12 6 15
11 4...

output:

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

result:

ok 250000 token(s): yes count is 122161, no count is 127839

Test #3:

score: 5
Accepted
time: 49ms
memory: 3816kb

input:

7 250000
14 72 33 41
43 64 63 62
34 14 69 9
19 75 21 57
47 6 43 53
19 53 58 46
50 49 49 74
30 75 53 68
36 42 53 14
70 40 52 73
70 44 75 44
38 75 72 46
11 45 20 10
25 67 35 60
54 27 14 28
53 35 26 44
10 20 60 13
61 2 41 6
54 3 66 8
43 34 69 31
52 16 3 41
53 62 33 66
15 75 27 32
73 22 22 44
66 15 56 1...

output:

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

result:

ok 250000 token(s): yes count is 123236, no count is 126764

Test #4:

score: 5
Accepted
time: 42ms
memory: 3816kb

input:

42 250000
9 44 75 43
56 10 46 11
25 22 40 22
54 4 49 5
4 22 34 16
69 59 72 59
66 75 74 31
5 10 57 10
11 48 36 46
7 40 56 14
32 68 5 74
66 25 59 40
10 6 20 7
48 25 73 24
54 41 51 56
71 32 47 55
17 3 26 10
20 49 8 51
44 17 43 35
75 18 69 33
72 8 74 43
45 75 66 19
56 73 68 15
47 56 57 57
39 69 20 70
7 ...

output:

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

result:

ok 250000 token(s): yes count is 118956, no count is 131044

Test #5:

score: 5
Accepted
time: 48ms
memory: 3760kb

input:

74 250000
29 38 74 53
17 75 67 32
10 17 14 74
7 35 60 74
18 61 33 14
11 75 47 46
5 66 54 57
11 19 38 35
45 1 66 51
3 57 71 35
48 75 59 48
75 75 75 65
51 54 15 57
6 11 25 65
10 6 36 4
43 29 34 36
32 75 19 59
11 11 41 39
19 55 36 74
44 1 69 2
11 49 39 30
62 75 49 14
47 5 53 71
7 60 38 34
48 75 11 43
7...

output:

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

result:

ok 250000 token(s): yes count is 107243, no count is 142757

Test #6:

score: 5
Accepted
time: 48ms
memory: 3684kb

input:

33 250000
42 63 17 64
48 31 9 35
46 64 75 15
42 14 16 17
3 37 49 15
70 39 16 43
52 2 8 8
12 12 57 9
36 42 75 1
9 60 30 58
47 71 75 69
75 7 3 30
45 51 24 52
14 15 2 25
55 35 2 53
68 32 31 34
69 43 56 45
44 68 75 57
29 36 2 55
56 61 5 71
36 55 75 21
38 73 75 69
61 72 75 24
67 10 74 10
48 28 28 30
47 6...

output:

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

result:

ok 250000 token(s): yes count is 115599, no count is 134401

Test #7:

score: 5
Accepted
time: 52ms
memory: 3840kb

input:

20 250000
24 13 65 12
8 13 74 5
13 68 67 65
70 58 55 60
54 39 30 41
75 45 20 72
1 27 55 0
4 35 75 18
2 48 75 21
49 70 54 71
9 25 75 37
75 8 72 72
74 0 17 3
1 51 34 18
8 7 28 5
66 13 34 16
65 2 58 3
3 45 49 33
33 15 70 13
53 36 75 6
15 75 55 72
7 0 64 74
75 30 21 55
75 4 39 65
67 21 75 9
47 22 20 23
...

output:

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

result:

ok 250000 token(s): yes count is 118095, no count is 131905

Test #8:

score: 5
Accepted
time: 46ms
memory: 3696kb

input:

10 250000
50 31 58 32
17 66 46 63
8 39 35 36
75 42 49 64
28 68 75 9
3 73 10 71
64 54 23 58
33 32 16 35
8 31 63 24
51 7 75 65
60 11 38 15
12 75 75 3
4 52 28 45
24 54 2 71
44 39 24 42
46 41 75 4
1 39 74 3
75 9 41 48
75 9 61 72
58 44 74 42
66 34 28 38
64 30 72 29
34 46 62 44
75 6 17 68
29 16 1 45
63 38...

output:

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

result:

ok 250000 token(s): yes count is 123426, no count is 126574

Test #9:

score: 5
Accepted
time: 47ms
memory: 3692kb

input:

3 250000
44 27 71 1
61 15 13 29
48 7 36 37
23 71 28 11
39 10 14 6
24 64 39 29
48 28 23 58
22 14 34 64
36 55 29 45
5 55 69 38
56 48 56 63
67 61 24 44
38 6 47 38
3 22 6 59
7 71 4 41
34 8 55 63
53 56 43 7
5 51 5 75
53 72 8 14
40 37 42 14
58 19 70 50
71 13 56 52
42 12 37 62
73 19 58 24
64 63 46 64
46 31...

output:

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

result:

ok 250000 token(s): yes count is 130142, no count is 119858

Subtask #2:

score: 5
Accepted

Dependency #1:

100%
Accepted

Test #10:

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

input:

17 2
42 1 33 1
42 1 33 7

output:

YES
NO

result:

ok 2 token(s): yes count is 1, no count is 1

Test #11:

score: 5
Accepted
time: 50ms
memory: 3704kb

input:

3 250000
266 36 105 90
207 149 109 198
246 93 275 84
12 300 16 299
292 6 137 73
20 300 242 227
1 300 107 245
269 148 177 179
90 300 114 292
254 152 191 173
271 25 223 82
92 133 72 140
227 72 30 138
50 94 285 16
211 60 2 165
11 4 9 5
15 106 290 15
96 26 29 49
299 139 2 288
258 233 58 300
2 92 180 4
2...

output:

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

result:

ok 250000 token(s): yes count is 122039, no count is 127961

Test #12:

score: 5
Accepted
time: 54ms
memory: 3836kb

input:

7 250000
253 123 35 260
296 180 68 288
181 141 2 231
22 300 105 71
134 271 52 300
22 184 191 172
195 279 62 299
36 125 181 93
125 300 215 240
101 36 296 10
2 196 275 60
215 144 190 300
150 104 127 191
132 102 56 113
109 206 85 234
27 41 24 42
84 286 122 201
261 282 139 300
90 31 19 42
62 42 98 37
15...

output:

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

result:

ok 250000 token(s): yes count is 116187, no count is 133813

Test #13:

score: 5
Accepted
time: 54ms
memory: 3764kb

input:

70 250000
113 275 266 273
134 300 177 202
290 217 109 230
230 62 235 62
173 272 267 271
130 99 233 72
73 91 299 88
159 300 172 286
198 134 113 136
280 48 96 300
299 91 271 92
133 143 51 145
128 120 130 120
123 180 2 300
139 265 161 213
231 94 6 132
270 233 4 300
134 228 179 228
2 246 165 165
244 14 ...

output:

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

result:

ok 250000 token(s): yes count is 123982, no count is 126018

Test #14:

score: 5
Accepted
time: 46ms
memory: 3836kb

input:

299 250000
277 284 19 298
177 147 109 148
101 300 152 190
183 235 168 300
93 116 257 46
242 300 245 136
88 300 184 298
94 191 26 194
273 41 10 273
53 172 139 171
134 262 83 263
99 211 194 300
167 130 90 212
2 260 105 209
171 167 145 300
151 247 94 248
227 127 59 213
35 10 197 6
52 66 226 225
297 300...

output:

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

result:

ok 250000 token(s): yes count is 109302, no count is 140698

Test #15:

score: 5
Accepted
time: 53ms
memory: 3664kb

input:

300 250000
137 295 278 80
5 281 84 152
153 300 104 145
244 36 196 132
95 300 243 109
118 26 105 29
176 3 178 135
123 166 78 286
199 232 16 300
97 174 162 150
72 274 122 36
81 271 31 273
239 107 60 300
9 282 16 40
250 13 239 144
116 199 20 245
181 183 88 300
28 204 259 196
156 195 253 195
177 259 39 ...

output:

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

result:

ok 250000 token(s): yes count is 105672, no count is 144328

Test #16:

score: 5
Accepted
time: 48ms
memory: 3836kb

input:

99 250000
257 74 300 26
114 83 300 1
157 243 300 1
242 119 85 121
83 148 300 59
201 1 147 2
35 72 117 71
194 209 3 272
157 139 201 139
295 0 126 2
130 7 1 137
29 68 183 64
165 1 193 1
290 0 201 1
98 259 46 261
134 1 178 1
110 2 237 1
96 17 300 130
144 34 2 87
272 1 297 2
174 0 71 1
263 0 25 1
125 98...

output:

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

result:

ok 250000 token(s): yes count is 152693, no count is 97307

Test #17:

score: 5
Accepted
time: 45ms
memory: 3848kb

input:

142 250000
8 192 121 180
93 243 9 253
256 220 300 1
129 130 2 194
246 204 226 205
174 2 272 1
223 130 24 138
57 264 280 260
146 231 300 9
64 238 45 239
248 199 111 200
2 250 191 179
191 2 299 1
163 70 186 70
143 35 300 1
55 287 300 150
2 276 224 188
61 217 300 28
2 159 142 95
277 254 300 1
180 0 272...

output:

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

result:

ok 250000 token(s): yes count is 135315, no count is 114685

Test #18:

score: 5
Accepted
time: 52ms
memory: 3816kb

input:

10 250000
140 238 213 15
209 29 275 205
7 3 39 0
267 152 14 81
295 282 40 1
236 73 164 97
198 10 165 172
155 223 30 9
275 3 33 27
72 203 162 6
269 131 161 179
286 115 2 236
183 186 151 107
113 222 2 211
289 64 188 256
149 236 53 110
218 212 103 158
123 42 13 97
242 26 266 24
30 20 204 3
268 97 286 2...

output:

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

result:

ok 250000 token(s): yes count is 165023, no count is 84977

Test #19:

score: 5
Accepted
time: 52ms
memory: 3816kb

input:

15 250000
140 238 213 15
209 29 275 205
20 2 38 1
267 152 14 81
295 282 40 1
236 73 164 97
198 10 165 172
155 223 30 9
202 2 33 13
72 203 162 6
269 131 161 179
286 115 2 236
183 186 151 107
113 222 2 211
289 64 188 256
149 236 53 110
218 212 103 158
208 157 112 97
26 18 275 1
166 13 206 11
268 97 28...

output:

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

result:

ok 250000 token(s): yes count is 162083, no count is 87917

Test #20:

score: 5
Accepted
time: 48ms
memory: 3812kb

input:

2 250000
75 16 56 55
50 9 49 60
18 67 62 5
30 54 61 39
22 39 42 31
26 30 55 1
23 30 53 16
55 13 6 44
69 8 58 72
53 7 60 12
29 14 26 34
37 64 24 71
19 3 40 1
64 13 33 65
67 24 68 3
64 17 50 66
71 6 62 13
15 29 26 24
51 30 34 45
46 5 40 72
54 52 60 49
35 21 18 30
39 31 35 34
30 74 72 5
74 12 6 15
11 4...

output:

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

result:

ok 250000 token(s): yes count is 122161, no count is 127839

Test #21:

score: 5
Accepted
time: 46ms
memory: 3740kb

input:

7 250000
14 72 33 41
43 64 63 62
34 14 69 9
19 75 21 57
47 6 43 53
19 53 58 46
50 49 49 74
30 75 53 68
36 42 53 14
70 40 52 73
70 44 75 44
38 75 72 46
11 45 20 10
25 67 35 60
54 27 14 28
53 35 26 44
10 20 60 13
61 2 41 6
54 3 66 8
43 34 69 31
52 16 3 41
53 62 33 66
15 75 27 32
73 22 22 44
66 15 56 1...

output:

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

result:

ok 250000 token(s): yes count is 123236, no count is 126764

Test #22:

score: 5
Accepted
time: 43ms
memory: 3844kb

input:

42 250000
9 44 75 43
56 10 46 11
25 22 40 22
54 4 49 5
4 22 34 16
69 59 72 59
66 75 74 31
5 10 57 10
11 48 36 46
7 40 56 14
32 68 5 74
66 25 59 40
10 6 20 7
48 25 73 24
54 41 51 56
71 32 47 55
17 3 26 10
20 49 8 51
44 17 43 35
75 18 69 33
72 8 74 43
45 75 66 19
56 73 68 15
47 56 57 57
39 69 20 70
7 ...

output:

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

result:

ok 250000 token(s): yes count is 118956, no count is 131044

Test #23:

score: 5
Accepted
time: 44ms
memory: 3764kb

input:

74 250000
29 38 74 53
17 75 67 32
10 17 14 74
7 35 60 74
18 61 33 14
11 75 47 46
5 66 54 57
11 19 38 35
45 1 66 51
3 57 71 35
48 75 59 48
75 75 75 65
51 54 15 57
6 11 25 65
10 6 36 4
43 29 34 36
32 75 19 59
11 11 41 39
19 55 36 74
44 1 69 2
11 49 39 30
62 75 49 14
47 5 53 71
7 60 38 34
48 75 11 43
7...

output:

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

result:

ok 250000 token(s): yes count is 107243, no count is 142757

Test #24:

score: 5
Accepted
time: 73ms
memory: 3840kb

input:

33 250000
42 63 17 64
48 31 9 35
46 64 75 15
42 14 16 17
3 37 49 15
70 39 16 43
52 2 8 8
12 12 57 9
36 42 75 1
9 60 30 58
47 71 75 69
75 7 3 30
45 51 24 52
14 15 2 25
55 35 2 53
68 32 31 34
69 43 56 45
44 68 75 57
29 36 2 55
56 61 5 71
36 55 75 21
38 73 75 69
61 72 75 24
67 10 74 10
48 28 28 30
47 6...

output:

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

result:

ok 250000 token(s): yes count is 115599, no count is 134401

Test #25:

score: 5
Accepted
time: 47ms
memory: 3692kb

input:

20 250000
24 13 65 12
8 13 74 5
13 68 67 65
70 58 55 60
54 39 30 41
75 45 20 72
1 27 55 0
4 35 75 18
2 48 75 21
49 70 54 71
9 25 75 37
75 8 72 72
74 0 17 3
1 51 34 18
8 7 28 5
66 13 34 16
65 2 58 3
3 45 49 33
33 15 70 13
53 36 75 6
15 75 55 72
7 0 64 74
75 30 21 55
75 4 39 65
67 21 75 9
47 22 20 23
...

output:

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

result:

ok 250000 token(s): yes count is 118095, no count is 131905

Test #26:

score: 5
Accepted
time: 42ms
memory: 3704kb

input:

10 250000
50 31 58 32
17 66 46 63
8 39 35 36
75 42 49 64
28 68 75 9
3 73 10 71
64 54 23 58
33 32 16 35
8 31 63 24
51 7 75 65
60 11 38 15
12 75 75 3
4 52 28 45
24 54 2 71
44 39 24 42
46 41 75 4
1 39 74 3
75 9 41 48
75 9 61 72
58 44 74 42
66 34 28 38
64 30 72 29
34 46 62 44
75 6 17 68
29 16 1 45
63 38...

output:

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

result:

ok 250000 token(s): yes count is 123426, no count is 126574

Test #27:

score: 5
Accepted
time: 39ms
memory: 3836kb

input:

3 250000
44 27 71 1
61 15 13 29
48 7 36 37
23 71 28 11
39 10 14 6
24 64 39 29
48 28 23 58
22 14 34 64
36 55 29 45
5 55 69 38
56 48 56 63
67 61 24 44
38 6 47 38
3 22 6 59
7 71 4 41
34 8 55 63
53 56 43 7
5 51 5 75
53 72 8 14
40 37 42 14
58 19 70 50
71 13 56 52
42 12 37 62
73 19 58 24
64 63 46 64
46 31...

output:

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

result:

ok 250000 token(s): yes count is 130142, no count is 119858

Subtask #3:

score: 10
Accepted

Test #28:

score: 10
Accepted
time: 87ms
memory: 3832kb

input:

1 250000
554333015044 833858497873 833858497874 554333015044
655160857180 306396306924 306396306917 655160857187
374728598365 176680698490 176680698490 374728598365
764650258714 835600427315 835600427309 764650258720
521594231110 318048536486 318048536482 521594231115
273627794040 449769302710 10899...

output:

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

result:

ok 250000 token(s): yes count is 126293, no count is 123707

Test #29:

score: 10
Accepted
time: 81ms
memory: 3756kb

input:

1 250000
129596328651 633211431893 1 762807760544
1 983509496641 151077576062 229908055916
36498040145 186033440917 1 995620003790
247250323075 720548396611 720548396605 247250323082
464252981836 491098062545 12027035640 943324008741
719683599156 92798217394 1 812481816550
317330065824 621406415744 ...

output:

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

result:

ok 250000 token(s): yes count is 143356, no count is 106644

Test #30:

score: 10
Accepted
time: 84ms
memory: 3756kb

input:

1 250000
807680045522 377273608557 256372130241 928581523838
536035116725 716237980103 379308294473 872964802356
1 882064014033 529720193901 352343820133
80961796479 258174541326 183165451143 155970886662
739448494904 100650373373 75082626963 765016241315
166426307909 865864146065 703399919607 32889...

output:

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

result:

ok 250000 token(s): yes count is 132783, no count is 117217

Test #31:

score: 10
Accepted
time: 1ms
memory: 3744kb

input:

1 1
999999999999 999999999999 999999999999 999999999999

output:

YES

result:

ok YES

Subtask #4:

score: 25
Accepted

Dependency #2:

100%
Accepted

Test #32:

score: 25
Accepted
time: 0ms
memory: 3804kb

input:

17 2
42 1 33 1
42 1 33 7

output:

YES
NO

result:

ok 2 token(s): yes count is 1, no count is 1

Test #33:

score: 25
Accepted
time: 54ms
memory: 3896kb

input:

3 250000
266 36 105 90
207 149 109 198
246 93 275 84
12 300 16 299
292 6 137 73
20 300 242 227
1 300 107 245
269 148 177 179
90 300 114 292
254 152 191 173
271 25 223 82
92 133 72 140
227 72 30 138
50 94 285 16
211 60 2 165
11 4 9 5
15 106 290 15
96 26 29 49
299 139 2 288
258 233 58 300
2 92 180 4
2...

output:

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

result:

ok 250000 token(s): yes count is 122039, no count is 127961

Test #34:

score: 25
Accepted
time: 38ms
memory: 3700kb

input:

7 250000
253 123 35 260
296 180 68 288
181 141 2 231
22 300 105 71
134 271 52 300
22 184 191 172
195 279 62 299
36 125 181 93
125 300 215 240
101 36 296 10
2 196 275 60
215 144 190 300
150 104 127 191
132 102 56 113
109 206 85 234
27 41 24 42
84 286 122 201
261 282 139 300
90 31 19 42
62 42 98 37
15...

output:

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

result:

ok 250000 token(s): yes count is 116187, no count is 133813

Test #35:

score: 25
Accepted
time: 57ms
memory: 3784kb

input:

70 250000
113 275 266 273
134 300 177 202
290 217 109 230
230 62 235 62
173 272 267 271
130 99 233 72
73 91 299 88
159 300 172 286
198 134 113 136
280 48 96 300
299 91 271 92
133 143 51 145
128 120 130 120
123 180 2 300
139 265 161 213
231 94 6 132
270 233 4 300
134 228 179 228
2 246 165 165
244 14 ...

output:

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

result:

ok 250000 token(s): yes count is 123982, no count is 126018

Test #36:

score: 25
Accepted
time: 54ms
memory: 3760kb

input:

299 250000
277 284 19 298
177 147 109 148
101 300 152 190
183 235 168 300
93 116 257 46
242 300 245 136
88 300 184 298
94 191 26 194
273 41 10 273
53 172 139 171
134 262 83 263
99 211 194 300
167 130 90 212
2 260 105 209
171 167 145 300
151 247 94 248
227 127 59 213
35 10 197 6
52 66 226 225
297 300...

output:

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

result:

ok 250000 token(s): yes count is 109302, no count is 140698

Test #37:

score: 25
Accepted
time: 50ms
memory: 3756kb

input:

300 250000
137 295 278 80
5 281 84 152
153 300 104 145
244 36 196 132
95 300 243 109
118 26 105 29
176 3 178 135
123 166 78 286
199 232 16 300
97 174 162 150
72 274 122 36
81 271 31 273
239 107 60 300
9 282 16 40
250 13 239 144
116 199 20 245
181 183 88 300
28 204 259 196
156 195 253 195
177 259 39 ...

output:

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

result:

ok 250000 token(s): yes count is 105672, no count is 144328

Test #38:

score: 25
Accepted
time: 48ms
memory: 3860kb

input:

99 250000
257 74 300 26
114 83 300 1
157 243 300 1
242 119 85 121
83 148 300 59
201 1 147 2
35 72 117 71
194 209 3 272
157 139 201 139
295 0 126 2
130 7 1 137
29 68 183 64
165 1 193 1
290 0 201 1
98 259 46 261
134 1 178 1
110 2 237 1
96 17 300 130
144 34 2 87
272 1 297 2
174 0 71 1
263 0 25 1
125 98...

output:

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

result:

ok 250000 token(s): yes count is 152693, no count is 97307

Test #39:

score: 25
Accepted
time: 55ms
memory: 3792kb

input:

142 250000
8 192 121 180
93 243 9 253
256 220 300 1
129 130 2 194
246 204 226 205
174 2 272 1
223 130 24 138
57 264 280 260
146 231 300 9
64 238 45 239
248 199 111 200
2 250 191 179
191 2 299 1
163 70 186 70
143 35 300 1
55 287 300 150
2 276 224 188
61 217 300 28
2 159 142 95
277 254 300 1
180 0 272...

output:

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

result:

ok 250000 token(s): yes count is 135315, no count is 114685

Test #40:

score: 25
Accepted
time: 52ms
memory: 3744kb

input:

10 250000
140 238 213 15
209 29 275 205
7 3 39 0
267 152 14 81
295 282 40 1
236 73 164 97
198 10 165 172
155 223 30 9
275 3 33 27
72 203 162 6
269 131 161 179
286 115 2 236
183 186 151 107
113 222 2 211
289 64 188 256
149 236 53 110
218 212 103 158
123 42 13 97
242 26 266 24
30 20 204 3
268 97 286 2...

output:

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

result:

ok 250000 token(s): yes count is 165023, no count is 84977

Test #41:

score: 25
Accepted
time: 44ms
memory: 3824kb

input:

15 250000
140 238 213 15
209 29 275 205
20 2 38 1
267 152 14 81
295 282 40 1
236 73 164 97
198 10 165 172
155 223 30 9
202 2 33 13
72 203 162 6
269 131 161 179
286 115 2 236
183 186 151 107
113 222 2 211
289 64 188 256
149 236 53 110
218 212 103 158
208 157 112 97
26 18 275 1
166 13 206 11
268 97 28...

output:

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

result:

ok 250000 token(s): yes count is 162083, no count is 87917

Test #42:

score: 25
Accepted
time: 75ms
memory: 3872kb

input:

342 250000
408 1209 111 2000
1902 1357 688 2000
1691 1272 471 1464
1385 1170 2 1862
508 1011 1329 672
1374 527 788 2000
31 2000 893 1002
983 267 616 269
112 2000 521 1997
1729 865 976 868
1190 2000 1373 1987
647 2000 1639 1941
1266 1978 56 2000
3 1771 1669 1216
857 1141 410 1143
803 1101 897 108
401...

output:

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

result:

ok 250000 token(s): yes count is 124862, no count is 125138

Test #43:

score: 25
Accepted
time: 33ms
memory: 3696kb

input:

2 250000
75 16 56 55
50 9 49 60
18 67 62 5
30 54 61 39
22 39 42 31
26 30 55 1
23 30 53 16
55 13 6 44
69 8 58 72
53 7 60 12
29 14 26 34
37 64 24 71
19 3 40 1
64 13 33 65
67 24 68 3
64 17 50 66
71 6 62 13
15 29 26 24
51 30 34 45
46 5 40 72
54 52 60 49
35 21 18 30
39 31 35 34
30 74 72 5
74 12 6 15
11 4...

output:

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

result:

ok 250000 token(s): yes count is 122161, no count is 127839

Test #44:

score: 25
Accepted
time: 49ms
memory: 3816kb

input:

4 250000
36 373 1491 10
1163 2000 1936 1807
643 2000 1195 1862
1175 1938 935 1999
415 131 112 207
1603 1603 18 2000
259 2000 424 1959
1754 1892 1324 2000
1392 2000 1493 1975
976 1987 927 2000
91 1965 2 2000
1820 1934 1560 2000
204 2000 1036 1793
1419 1695 200 2000
1613 1834 952 2000
1 2000 175 1827
...

output:

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

result:

ok 250000 token(s): yes count is 124125, no count is 125875

Test #45:

score: 25
Accepted
time: 68ms
memory: 3896kb

input:

81 250000
594 2000 727 1697
337 6 51 12
2 1794 879 1356
1452 9 747 18
169 2000 1504 1984
1780 1992 1197 2000
1536 1999 1714 1997
59 16 981 1
540 2000 1939 1983
396 1615 1461 648
2 1942 753 1567
1496 1981 78 2000
486 2000 1917 1983
1699 12 1038 21
76 22 113 22
726 2000 1313 1993
1933 1128 3 2000
349 ...

output:

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

result:

ok 250000 token(s): yes count is 124416, no count is 125584

Test #46:

score: 25
Accepted
time: 62ms
memory: 3704kb

input:

2000 250000
1019 1670 635 2000
660 2000 988 1703
684 72 1518 98
529 1994 80 2000
1908 1218 528 1221
1106 632 1783 679
189 192 1134 1874
1343 421 513 423
379 2000 992 1211
795 1281 1815 1280
1614 1461 1883 1189
795 1600 276 2000
102 1370 918 807
1654 1316 1055 2000
299 7 1972 1994
453 738 1185 737
13...

output:

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

result:

ok 250000 token(s): yes count is 106884, no count is 143116

Test #47:

score: 25
Accepted
time: 55ms
memory: 3956kb

input:

1042 250000
1652 487 1949 487
314 1904 422 1904
1603 1999 1481 2000
2 1930 1519 1172
1707 355 2 1208
1498 1777 1364 2000
1597 1999 1937 1534
1435 1961 1792 1961
1237 2000 1346 971
543 1055 587 1056
1082 1886 1367 1409
1093 2000 1552 1252
1637 1998 1094 2000
1650 487 1239 488
1253 1999 1343 1878
1228...

output:

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

result:

ok 250000 token(s): yes count is 124749, no count is 125251

Test #48:

score: 25
Accepted
time: 78ms
memory: 3904kb

input:

499 250000
2 1881 1997 98
1123 2000 1525 1885
1351 1939 374 1942
514 1994 1184 1993
1231 945 1124 2000
4 2000 1451 1632
1446 392 854 1164
1139 1773 1377 1773
2 1915 1083 1375
1157 2000 1577 1999
2 1886 1951 912
1444 1894 1530 969
1129 1987 609 1989
1289 1737 1930 1736
801 2000 1896 1543
2 1017 1767 ...

output:

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

result:

ok 250000 token(s): yes count is 124920, no count is 125080

Test #49:

score: 25
Accepted
time: 66ms
memory: 3984kb

input:

1337 250000
381 1 1816 0
1582 0 203 1
1493 0 437 1
1828 0 146 1
1477 0 345 1
1943 0 219 1
418 1 1919 0
375 1 1959 0
1527 1 1991 1
1584 0 792 1
1890 0 1151 1
1340 1 1673 1
1435 0 367 1
1346 0 526 1
1818 0 347 1
1699 0 176 1
1619 0 361 1
1905 0 253 1
196 1 1748 0
1559 0 151 1
1660 0 674 1
1897 0 134 1...

output:

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

result:

ok 250000 token(s): yes count is 174050, no count is 75950

Test #50:

score: 25
Accepted
time: 49ms
memory: 3844kb

input:

42 250000
800 31 1306 19
763 6 291 18
1402 19 822 33
1183 25 1082 28
1636 34 1439 38
1997 1 76 47
1546 41 1735 36
1911 9 396 45
65 23 983 1
1842 20 841 43
757 7 321 18
558 32 1381 13
383 18 790 9
149 40 1682 3
1827 35 1486 43
87 44 1886 2
842 17 745 20
918 31 1329 21
1807 22 958 43
1125 22 944 26
14...

output:

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

result:

ok 250000 token(s): yes count is 236890, no count is 13110

Test #51:

score: 25
Accepted
time: 57ms
memory: 3912kb

input:

300 250000
522 0 286 1
95 6 1961 0
1747 4 1466 5
1475 3 1013 4
1864 5 1547 6
1652 3 1066 5
1655 3 1022 5
744 1 412 2
1723 6 1949 5
78 1 529 0
839 4 1273 2
1244 6 1963 4
872 6 1816 2
1451 6 1811 4
1244 5 1780 4
1897 1 415 6
1781 0 260 5
1631 5 1743 5
1888 0 15 6
243 5 1685 0
338 0 277 1
1385 3 943 4
...

output:

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

result:

ok 250000 token(s): yes count is 197405, no count is 52595

Test #52:

score: 25
Accepted
time: 69ms
memory: 3848kb

input:

75 250000
1849 418 1349 425
1949 607 1998 607
1775 1646 1349 1652
1775 1934 1349 1940
1349 1118 1701 1114
1424 678 1997 671
1849 643 1724 645
1627 1494 1724 1493
1724 1291 1849 1290
1949 1880 1627 1885
1724 770 1923 768
1849 460 1499 465
1997 420 1499 427
1349 1899 1627 1896
1874 1961 1997 1960
1701...

output:

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

result:

ok 250000 token(s): yes count is 126447, no count is 123553

Test #53:

score: 25
Accepted
time: 41ms
memory: 3756kb

input:

7 250000
14 72 33 41
43 64 63 62
34 14 69 9
19 75 21 57
47 6 43 53
19 53 58 46
50 49 49 74
30 75 53 68
36 42 53 14
70 40 52 73
70 44 75 44
38 75 72 46
11 45 20 10
25 67 35 60
54 27 14 28
53 35 26 44
10 20 60 13
61 2 41 6
54 3 66 8
43 34 69 31
52 16 3 41
53 62 33 66
15 75 27 32
73 22 22 44
66 15 56 1...

output:

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

result:

ok 250000 token(s): yes count is 123236, no count is 126764

Test #54:

score: 25
Accepted
time: 51ms
memory: 3840kb

input:

42 250000
9 44 75 43
56 10 46 11
25 22 40 22
54 4 49 5
4 22 34 16
69 59 72 59
66 75 74 31
5 10 57 10
11 48 36 46
7 40 56 14
32 68 5 74
66 25 59 40
10 6 20 7
48 25 73 24
54 41 51 56
71 32 47 55
17 3 26 10
20 49 8 51
44 17 43 35
75 18 69 33
72 8 74 43
45 75 66 19
56 73 68 15
47 56 57 57
39 69 20 70
7 ...

output:

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

result:

ok 250000 token(s): yes count is 118956, no count is 131044

Test #55:

score: 25
Accepted
time: 44ms
memory: 3820kb

input:

74 250000
29 38 74 53
17 75 67 32
10 17 14 74
7 35 60 74
18 61 33 14
11 75 47 46
5 66 54 57
11 19 38 35
45 1 66 51
3 57 71 35
48 75 59 48
75 75 75 65
51 54 15 57
6 11 25 65
10 6 36 4
43 29 34 36
32 75 19 59
11 11 41 39
19 55 36 74
44 1 69 2
11 49 39 30
62 75 49 14
47 5 53 71
7 60 38 34
48 75 11 43
7...

output:

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

result:

ok 250000 token(s): yes count is 107243, no count is 142757

Test #56:

score: 25
Accepted
time: 52ms
memory: 3700kb

input:

33 250000
42 63 17 64
48 31 9 35
46 64 75 15
42 14 16 17
3 37 49 15
70 39 16 43
52 2 8 8
12 12 57 9
36 42 75 1
9 60 30 58
47 71 75 69
75 7 3 30
45 51 24 52
14 15 2 25
55 35 2 53
68 32 31 34
69 43 56 45
44 68 75 57
29 36 2 55
56 61 5 71
36 55 75 21
38 73 75 69
61 72 75 24
67 10 74 10
48 28 28 30
47 6...

output:

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

result:

ok 250000 token(s): yes count is 115599, no count is 134401

Test #57:

score: 25
Accepted
time: 51ms
memory: 3888kb

input:

20 250000
24 13 65 12
8 13 74 5
13 68 67 65
70 58 55 60
54 39 30 41
75 45 20 72
1 27 55 0
4 35 75 18
2 48 75 21
49 70 54 71
9 25 75 37
75 8 72 72
74 0 17 3
1 51 34 18
8 7 28 5
66 13 34 16
65 2 58 3
3 45 49 33
33 15 70 13
53 36 75 6
15 75 55 72
7 0 64 74
75 30 21 55
75 4 39 65
67 21 75 9
47 22 20 23
...

output:

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

result:

ok 250000 token(s): yes count is 118095, no count is 131905

Test #58:

score: 25
Accepted
time: 39ms
memory: 3760kb

input:

10 250000
50 31 58 32
17 66 46 63
8 39 35 36
75 42 49 64
28 68 75 9
3 73 10 71
64 54 23 58
33 32 16 35
8 31 63 24
51 7 75 65
60 11 38 15
12 75 75 3
4 52 28 45
24 54 2 71
44 39 24 42
46 41 75 4
1 39 74 3
75 9 41 48
75 9 61 72
58 44 74 42
66 34 28 38
64 30 72 29
34 46 62 44
75 6 17 68
29 16 1 45
63 38...

output:

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

result:

ok 250000 token(s): yes count is 123426, no count is 126574

Test #59:

score: 25
Accepted
time: 39ms
memory: 3756kb

input:

3 250000
44 27 71 1
61 15 13 29
48 7 36 37
23 71 28 11
39 10 14 6
24 64 39 29
48 28 23 58
22 14 34 64
36 55 29 45
5 55 69 38
56 48 56 63
67 61 24 44
38 6 47 38
3 22 6 59
7 71 4 41
34 8 55 63
53 56 43 7
5 51 5 75
53 72 8 14
40 37 42 14
58 19 70 50
71 13 56 52
42 12 37 62
73 19 58 24
64 63 46 64
46 31...

output:

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

result:

ok 250000 token(s): yes count is 130142, no count is 119858

Subtask #5:

score: 20
Accepted

Dependency #3:

100%
Accepted

Test #60:

score: 20
Accepted
time: 87ms
memory: 3756kb

input:

1 250000
554333015044 833858497873 833858497874 554333015044
655160857180 306396306924 306396306917 655160857187
374728598365 176680698490 176680698490 374728598365
764650258714 835600427315 835600427309 764650258720
521594231110 318048536486 318048536482 521594231115
273627794040 449769302710 10899...

output:

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

result:

ok 250000 token(s): yes count is 126293, no count is 123707

Test #61:

score: 20
Accepted
time: 48ms
memory: 3836kb

input:

33 250000
42 63 17 64
48 31 9 35
46 64 75 15
42 14 16 17
3 37 49 15
70 39 16 43
52 2 8 8
12 12 57 9
36 42 75 1
9 60 30 58
47 71 75 69
75 7 3 30
45 51 24 52
14 15 2 25
55 35 2 53
68 32 31 34
69 43 56 45
44 68 75 57
29 36 2 55
56 61 5 71
36 55 75 21
38 73 75 69
61 72 75 24
67 10 74 10
48 28 28 30
47 6...

output:

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

result:

ok 250000 token(s): yes count is 115599, no count is 134401

Test #62:

score: 20
Accepted
time: 51ms
memory: 3760kb

input:

20 250000
24 13 65 12
8 13 74 5
13 68 67 65
70 58 55 60
54 39 30 41
75 45 20 72
1 27 55 0
4 35 75 18
2 48 75 21
49 70 54 71
9 25 75 37
75 8 72 72
74 0 17 3
1 51 34 18
8 7 28 5
66 13 34 16
65 2 58 3
3 45 49 33
33 15 70 13
53 36 75 6
15 75 55 72
7 0 64 74
75 30 21 55
75 4 39 65
67 21 75 9
47 22 20 23
...

output:

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

result:

ok 250000 token(s): yes count is 118095, no count is 131905

Test #63:

score: 20
Accepted
time: 46ms
memory: 3756kb

input:

10 250000
50 31 58 32
17 66 46 63
8 39 35 36
75 42 49 64
28 68 75 9
3 73 10 71
64 54 23 58
33 32 16 35
8 31 63 24
51 7 75 65
60 11 38 15
12 75 75 3
4 52 28 45
24 54 2 71
44 39 24 42
46 41 75 4
1 39 74 3
75 9 41 48
75 9 61 72
58 44 74 42
66 34 28 38
64 30 72 29
34 46 62 44
75 6 17 68
29 16 1 45
63 38...

output:

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

result:

ok 250000 token(s): yes count is 123426, no count is 126574

Test #64:

score: 20
Accepted
time: 47ms
memory: 3684kb

input:

3 250000
44 27 71 1
61 15 13 29
48 7 36 37
23 71 28 11
39 10 14 6
24 64 39 29
48 28 23 58
22 14 34 64
36 55 29 45
5 55 69 38
56 48 56 63
67 61 24 44
38 6 47 38
3 22 6 59
7 71 4 41
34 8 55 63
53 56 43 7
5 51 5 75
53 72 8 14
40 37 42 14
58 19 70 50
71 13 56 52
42 12 37 62
73 19 58 24
64 63 46 64
46 31...

output:

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

result:

ok 250000 token(s): yes count is 130142, no count is 119858

Test #65:

score: 20
Accepted
time: 55ms
memory: 3812kb

input:

3 250000
266 36 105 90
207 149 109 198
246 93 275 84
12 300 16 299
292 6 137 73
20 300 242 227
1 300 107 245
269 148 177 179
90 300 114 292
254 152 191 173
271 25 223 82
92 133 72 140
227 72 30 138
50 94 285 16
211 60 2 165
11 4 9 5
15 106 290 15
96 26 29 49
299 139 2 288
258 233 58 300
2 92 180 4
2...

output:

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

result:

ok 250000 token(s): yes count is 122039, no count is 127961

Test #66:

score: 20
Accepted
time: 50ms
memory: 3816kb

input:

7 250000
253 123 35 260
296 180 68 288
181 141 2 231
22 300 105 71
134 271 52 300
22 184 191 172
195 279 62 299
36 125 181 93
125 300 215 240
101 36 296 10
2 196 275 60
215 144 190 300
150 104 127 191
132 102 56 113
109 206 85 234
27 41 24 42
84 286 122 201
261 282 139 300
90 31 19 42
62 42 98 37
15...

output:

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

result:

ok 250000 token(s): yes count is 116187, no count is 133813

Test #67:

score: 20
Accepted
time: 58ms
memory: 3836kb

input:

70 250000
113 275 266 273
134 300 177 202
290 217 109 230
230 62 235 62
173 272 267 271
130 99 233 72
73 91 299 88
159 300 172 286
198 134 113 136
280 48 96 300
299 91 271 92
133 143 51 145
128 120 130 120
123 180 2 300
139 265 161 213
231 94 6 132
270 233 4 300
134 228 179 228
2 246 165 165
244 14 ...

output:

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

result:

ok 250000 token(s): yes count is 123982, no count is 126018

Test #68:

score: 20
Accepted
time: 38ms
memory: 3688kb

input:

299 250000
277 284 19 298
177 147 109 148
101 300 152 190
183 235 168 300
93 116 257 46
242 300 245 136
88 300 184 298
94 191 26 194
273 41 10 273
53 172 139 171
134 262 83 263
99 211 194 300
167 130 90 212
2 260 105 209
171 167 145 300
151 247 94 248
227 127 59 213
35 10 197 6
52 66 226 225
297 300...

output:

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

result:

ok 250000 token(s): yes count is 109302, no count is 140698

Test #69:

score: 20
Accepted
time: 54ms
memory: 3760kb

input:

300 250000
137 295 278 80
5 281 84 152
153 300 104 145
244 36 196 132
95 300 243 109
118 26 105 29
176 3 178 135
123 166 78 286
199 232 16 300
97 174 162 150
72 274 122 36
81 271 31 273
239 107 60 300
9 282 16 40
250 13 239 144
116 199 20 245
181 183 88 300
28 204 259 196
156 195 253 195
177 259 39 ...

output:

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

result:

ok 250000 token(s): yes count is 105672, no count is 144328

Test #70:

score: 20
Accepted
time: 52ms
memory: 3788kb

input:

99 250000
257 74 300 26
114 83 300 1
157 243 300 1
242 119 85 121
83 148 300 59
201 1 147 2
35 72 117 71
194 209 3 272
157 139 201 139
295 0 126 2
130 7 1 137
29 68 183 64
165 1 193 1
290 0 201 1
98 259 46 261
134 1 178 1
110 2 237 1
96 17 300 130
144 34 2 87
272 1 297 2
174 0 71 1
263 0 25 1
125 98...

output:

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

result:

ok 250000 token(s): yes count is 152693, no count is 97307

Test #71:

score: 20
Accepted
time: 77ms
memory: 3816kb

input:

1 250000
129596328651 633211431893 1 762807760544
1 983509496641 151077576062 229908055916
36498040145 186033440917 1 995620003790
247250323075 720548396611 720548396605 247250323082
464252981836 491098062545 12027035640 943324008741
719683599156 92798217394 1 812481816550
317330065824 621406415744 ...

output:

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

result:

ok 250000 token(s): yes count is 143356, no count is 106644

Test #72:

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

input:

142 250000
8 192 121 180
93 243 9 253
256 220 300 1
129 130 2 194
246 204 226 205
174 2 272 1
223 130 24 138
57 264 280 260
146 231 300 9
64 238 45 239
248 199 111 200
2 250 191 179
191 2 299 1
163 70 186 70
143 35 300 1
55 287 300 150
2 276 224 188
61 217 300 28
2 159 142 95
277 254 300 1
180 0 272...

output:

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

result:

ok 250000 token(s): yes count is 135315, no count is 114685

Test #73:

score: 20
Accepted
time: 48ms
memory: 3680kb

input:

10 250000
140 238 213 15
209 29 275 205
7 3 39 0
267 152 14 81
295 282 40 1
236 73 164 97
198 10 165 172
155 223 30 9
275 3 33 27
72 203 162 6
269 131 161 179
286 115 2 236
183 186 151 107
113 222 2 211
289 64 188 256
149 236 53 110
218 212 103 158
123 42 13 97
242 26 266 24
30 20 204 3
268 97 286 2...

output:

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

result:

ok 250000 token(s): yes count is 165023, no count is 84977

Test #74:

score: 20
Accepted
time: 48ms
memory: 3836kb

input:

15 250000
140 238 213 15
209 29 275 205
20 2 38 1
267 152 14 81
295 282 40 1
236 73 164 97
198 10 165 172
155 223 30 9
202 2 33 13
72 203 162 6
269 131 161 179
286 115 2 236
183 186 151 107
113 222 2 211
289 64 188 256
149 236 53 110
218 212 103 158
208 157 112 97
26 18 275 1
166 13 206 11
268 97 28...

output:

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

result:

ok 250000 token(s): yes count is 162083, no count is 87917

Test #75:

score: 20
Accepted
time: 1ms
memory: 3800kb

input:

2 1
1000000000000 0 1 1000000000000

output:

NO

result:

ok NO

Test #76:

score: 20
Accepted
time: 45ms
memory: 3780kb

input:

42 250000
800 31 1306 19
763 6 291 18
1402 19 822 33
1183 25 1082 28
1636 34 1439 38
1997 1 76 47
1546 41 1735 36
1911 9 396 45
65 23 983 1
1842 20 841 43
757 7 321 18
558 32 1381 13
383 18 790 9
149 40 1682 3
1827 35 1486 43
87 44 1886 2
842 17 745 20
918 31 1329 21
1807 22 958 43
1125 22 944 26
14...

output:

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

result:

ok 250000 token(s): yes count is 236890, no count is 13110

Test #77:

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

input:

300 250000
522 0 286 1
95 6 1961 0
1747 4 1466 5
1475 3 1013 4
1864 5 1547 6
1652 3 1066 5
1655 3 1022 5
744 1 412 2
1723 6 1949 5
78 1 529 0
839 4 1273 2
1244 6 1963 4
872 6 1816 2
1451 6 1811 4
1244 5 1780 4
1897 1 415 6
1781 0 260 5
1631 5 1743 5
1888 0 15 6
243 5 1685 0
338 0 277 1
1385 3 943 4
...

output:

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

result:

ok 250000 token(s): yes count is 197405, no count is 52595

Test #78:

score: 20
Accepted
time: 76ms
memory: 3860kb

input:

342 250000
408 1209 111 2000
1902 1357 688 2000
1691 1272 471 1464
1385 1170 2 1862
508 1011 1329 672
1374 527 788 2000
31 2000 893 1002
983 267 616 269
112 2000 521 1997
1729 865 976 868
1190 2000 1373 1987
647 2000 1639 1941
1266 1978 56 2000
3 1771 1669 1216
857 1141 410 1143
803 1101 897 108
401...

output:

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

result:

ok 250000 token(s): yes count is 124862, no count is 125138

Test #79:

score: 20
Accepted
time: 49ms
memory: 3756kb

input:

4 250000
36 373 1491 10
1163 2000 1936 1807
643 2000 1195 1862
1175 1938 935 1999
415 131 112 207
1603 1603 18 2000
259 2000 424 1959
1754 1892 1324 2000
1392 2000 1493 1975
976 1987 927 2000
91 1965 2 2000
1820 1934 1560 2000
204 2000 1036 1793
1419 1695 200 2000
1613 1834 952 2000
1 2000 175 1827
...

output:

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

result:

ok 250000 token(s): yes count is 124125, no count is 125875

Test #80:

score: 20
Accepted
time: 72ms
memory: 3812kb

input:

81 250000
594 2000 727 1697
337 6 51 12
2 1794 879 1356
1452 9 747 18
169 2000 1504 1984
1780 1992 1197 2000
1536 1999 1714 1997
59 16 981 1
540 2000 1939 1983
396 1615 1461 648
2 1942 753 1567
1496 1981 78 2000
486 2000 1917 1983
1699 12 1038 21
76 22 113 22
726 2000 1313 1993
1933 1128 3 2000
349 ...

output:

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

result:

ok 250000 token(s): yes count is 124416, no count is 125584

Test #81:

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

input:

399 250000
117973238523 513024052169 940125144496 510963521077
811297510904 497712169401 278621951769 499047195865
133838753727 833818856 188964221803 695659789
616511136507 989212710127 902399529842 988496197864
666566505255 1688066378 673538485220 1670592745
31923976042 345406452672 319754582069 3...

output:

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

result:

ok 250000 token(s): yes count is 125215, no count is 124785

Test #82:

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

input:

1 250000
807680045522 377273608557 256372130241 928581523838
536035116725 716237980103 379308294473 872964802356
1 882064014033 529720193901 352343820133
80961796479 258174541326 183165451143 155970886662
739448494904 100650373373 75082626963 765016241315
166426307909 865864146065 703399919607 32889...

output:

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

result:

ok 250000 token(s): yes count is 132783, no count is 117217

Test #83:

score: 20
Accepted
time: 83ms
memory: 3788kb

input:

397 250000
618442278236 882930407286 123797985649 884176362683
119166282089 188951143685 144 189778687310
249270498241 536986738793 169736862881 537187075406
162812939519 1999693300 414854688874 1364827433
41 1026949255 14334704114 677322327
333340873334 897924928447 225790703819 898195835675
604305...

output:

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

result:

ok 250000 token(s): yes count is 124605, no count is 125395

Test #84:

score: 20
Accepted
time: 93ms
memory: 3800kb

input:

196 250000
184778767653 724988347336 436828838936 723702377585
135665813919 540416702272 755059942224 537256528148
39105602872 920750486095 844898928719 916639295658
3996332306 550857227597 297542203728 549359544580
260448198835 927504024272 906265607520 924209037493
477476523943 813127345942 103770...

output:

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

result:

ok 250000 token(s): yes count is 125095, no count is 124905

Test #85:

score: 20
Accepted
time: 88ms
memory: 3772kb

input:

55 250000
274869231615 9092091213 81467836449 12608480217
905294302640 827591316673 732993268589 830724062747
509115780084 3110922106 171100715853 9256650547
8 663525628389 13175563438 661776266046
570316343025 746946171603 315626558334 751576894962
522801071055 62091957030 2 361081982370
9938409784...

output:

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

result:

ok 250000 token(s): yes count is 124912, no count is 125088

Test #86:

score: 20
Accepted
time: 92ms
memory: 3704kb

input:

30 250000
221258298107 351381514381 9 377943598488
760034554499 242670793277 256537339854 259454033766
541154529479 744128857052 34587880477 761014412019
15 31835419290 66562155496 27303114772
795868470600 855783375078 9550703549 881993967314
288214719569 606125536029 2603067931 615645924417
3464407...

output:

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

result:

ok 250000 token(s): yes count is 126028, no count is 123972

Test #87:

score: 20
Accepted
time: 87ms
memory: 3756kb

input:

7 250000
986464353782 9454938530 98000946639 138114393063
25897421993 446144089611 1 483098871270
3 281360159163 206359344706 213762916752
546527727801 820699776936 403800284041 841089411759
17650286094 126635860313 433379762058 67245935176
744543254112 611730074572 62341575022 709187457300
37856477...

output:

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

result:

ok 250000 token(s): yes count is 125281, no count is 124719

Test #88:

score: 20
Accepted
time: 58ms
memory: 3900kb

input:

400 250000
151228 0 399 379
84432 2 1199 211
98829 3 1599 247
353621 1 799 884
52610 3 1599 131
41183 0 399 103
134469 0 399 337
169997 1 799 425
350781 1 799 877
292151 0 399 732
195911 0 399 491
188814 3 1599 472
372008 3 1599 930
125608 2 1199 314
108006 3 1599 270
100902 3 1599 252
108551 0 399 ...

output:

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

result:

ok 250000 token(s): yes count is 125000, no count is 125000

Test #89:

score: 20
Accepted
time: 56ms
memory: 3896kb

input:

400 250000
151228 0 399 379
84432 2 1199 211
98829 3 1599 247
353621 1 799 884
52610 3 1599 131
41183 0 399 103
134469 0 399 337
169997 1 799 425
350781 1 799 877
292151 0 399 732
195911 0 399 491
188814 3 1599 472
372008 3 1599 930
125608 2 1199 314
108006 3 1599 270
100902 3 1599 252
108551 0 399 ...

output:

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

result:

ok 250000 token(s): yes count is 125000, no count is 125000

Test #90:

score: 20
Accepted
time: 85ms
memory: 3720kb

input:

42 250000
528133021628 877123441407 301254101993 77752117206
988511224716 338531611908 501193999197 187726824151
198354202042 138031889915 35062152723 885207065024
31895539568 108768653867 5306730504 968707601307
893469548022 301611733696 922647012155 170145752730
250350966289 802128707128 212116047...

output:

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

result:

ok 250000 token(s): yes count is 125334, no count is 124666

Test #91:

score: 20
Accepted
time: 104ms
memory: 3888kb

input:

142 250000
558089164124 448677664740 498149663092 980742085170
721 119622290215 118 119622290220
55286012184 776688000114 48081586476 784668171345
351446210665 1 568651912607 7
441547723834 975517758473 888937495689 509174740626
132 786460804875 1308 786460804867
638132286892 438621919405 7764975804...

output:

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

result:

ok 250000 token(s): yes count is 124682, no count is 125318

Test #92:

score: 20
Accepted
time: 139ms
memory: 4180kb

input:

300 250000
35539 31102416099 299 31102416217
26605 404096600351 299 404096600439
299 234409574874 12101 234409574835
314626867021 2 509076961816 7
261 277573598158 748 277573598157
8235 6160919498 298 6160919525
518195275945 8 838457569747 4
317456659770 1 513655662365 7
294 77256485799 8453 7725648...

output:

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

result:

ok 250000 token(s): yes count is 125000, no count is 125000

Test #93:

score: 20
Accepted
time: 0ms
memory: 3748kb

input:

1 1
999999999999 999999999999 999999999999 999999999999

output:

YES

result:

ok YES

Test #94:

score: 20
Accepted
time: 162ms
memory: 3836kb

input:

399 250000
279594328175 77561 452423817232 396
279594327776 64326 452418536467 395
452429618692 396 731987198568 92101
279594328574 53330 452414149063 397
452427773716 397 731987198967 87477
452424021919 394 731987197770 78074
279594326978 36482 452407426711 393
452417991433 397 731987198967 62960
4...

output:

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

result:

ok 250000 token(s): yes count is 127634, no count is 122366

Test #95:

score: 20
Accepted
time: 97ms
memory: 4096kb

input:

300 250000
772557904799 327286037294 391912683600 328554854698
995121117000 346402149815 628189556676 347625255017
729951499800 854196290983 289928908248 855663032955
97013284500 458196268400 98022671099 458192903779
501960891899 760564166756 562845012000 760361219689
479036861782 654854780091 39899...

output:

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

result:

ok 250000 token(s): yes count is 124342, no count is 125658

Test #96:

score: 20
Accepted
time: 68ms
memory: 3800kb

input:

396 250000
46331 33238006 2765 33238117
46331 16537062 2765 16537173
46331 3867997 2765 3868108
46331 33287533 2765 33287644
46331 33292889 2765 33293000
46331 3863273 2765 3863384
46331 3821963 2765 3822074
46331 33258407 2765 33258518
46331 7994813 2765 7994924
46331 33241889 2765 33242000
46331 3...

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

result:

ok 250000 token(s): yes count is 14943, no count is 235057

Test #97:

score: 20
Accepted
time: 0ms
memory: 3828kb

input:

17 2
42 1 33 1
42 1 33 7

output:

YES
NO

result:

ok 2 token(s): yes count is 1, no count is 1

Test #98:

score: 20
Accepted
time: 48ms
memory: 3760kb

input:

2 250000
75 16 56 55
50 9 49 60
18 67 62 5
30 54 61 39
22 39 42 31
26 30 55 1
23 30 53 16
55 13 6 44
69 8 58 72
53 7 60 12
29 14 26 34
37 64 24 71
19 3 40 1
64 13 33 65
67 24 68 3
64 17 50 66
71 6 62 13
15 29 26 24
51 30 34 45
46 5 40 72
54 52 60 49
35 21 18 30
39 31 35 34
30 74 72 5
74 12 6 15
11 4...

output:

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

result:

ok 250000 token(s): yes count is 122161, no count is 127839

Test #99:

score: 20
Accepted
time: 48ms
memory: 3760kb

input:

7 250000
14 72 33 41
43 64 63 62
34 14 69 9
19 75 21 57
47 6 43 53
19 53 58 46
50 49 49 74
30 75 53 68
36 42 53 14
70 40 52 73
70 44 75 44
38 75 72 46
11 45 20 10
25 67 35 60
54 27 14 28
53 35 26 44
10 20 60 13
61 2 41 6
54 3 66 8
43 34 69 31
52 16 3 41
53 62 33 66
15 75 27 32
73 22 22 44
66 15 56 1...

output:

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

result:

ok 250000 token(s): yes count is 123236, no count is 126764

Test #100:

score: 20
Accepted
time: 43ms
memory: 3764kb

input:

42 250000
9 44 75 43
56 10 46 11
25 22 40 22
54 4 49 5
4 22 34 16
69 59 72 59
66 75 74 31
5 10 57 10
11 48 36 46
7 40 56 14
32 68 5 74
66 25 59 40
10 6 20 7
48 25 73 24
54 41 51 56
71 32 47 55
17 3 26 10
20 49 8 51
44 17 43 35
75 18 69 33
72 8 74 43
45 75 66 19
56 73 68 15
47 56 57 57
39 69 20 70
7 ...

output:

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

result:

ok 250000 token(s): yes count is 118956, no count is 131044

Test #101:

score: 20
Accepted
time: 49ms
memory: 3820kb

input:

74 250000
29 38 74 53
17 75 67 32
10 17 14 74
7 35 60 74
18 61 33 14
11 75 47 46
5 66 54 57
11 19 38 35
45 1 66 51
3 57 71 35
48 75 59 48
75 75 75 65
51 54 15 57
6 11 25 65
10 6 36 4
43 29 34 36
32 75 19 59
11 11 41 39
19 55 36 74
44 1 69 2
11 49 39 30
62 75 49 14
47 5 53 71
7 60 38 34
48 75 11 43
7...

output:

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

result:

ok 250000 token(s): yes count is 107243, no count is 142757

Subtask #6:

score: 20
Accepted

Dependency #1:

100%
Accepted

Test #102:

score: 20
Accepted
time: 1ms
memory: 3676kb

input:

17 2
42 1 33 1
42 1 33 7

output:

YES
NO

result:

ok 2 token(s): yes count is 1, no count is 1

Test #103:

score: 20
Accepted
time: 57ms
memory: 3780kb

input:

42 250000
4872 44 1889 116
2940 47 1989 70
3401 74 3146 81
629 27 988 19
2765 125 4409 86
2056 125 4578 65
4953 9 118 125
486576003099 110 843475701009 97
5078 105 4242 125
121 70 71 72
313361668603 101 507029830192 68
3570 94 2302 125
808028848732 24 964525600627 54
3276 39 1670 78
1436 115 1049 12...

output:

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

result:

ok 250000 token(s): yes count is 127583, no count is 122417

Test #104:

score: 20
Accepted
time: 373ms
memory: 9540kb

input:

4711 250000
569918431634 39 857108209284 1
188255 96 456963 39
479796256308 10 776325805652 117
395721 123 522634 97
18816 125 542401 14
514919 125 584134 111
79935 87 414560 16
437225268144 123 707445756354 22
339146 125 382570 116
537029 71 337451 114
61176 125 143828 108
256751 57 3742 125
320316...

output:

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

result:

ok 250000 token(s): yes count is 128340, no count is 121660

Test #105:

score: 20
Accepted
time: 1919ms
memory: 30736kb

input:

24242 250000
1624048 109 2648467 67
3030067 88 2141356 125
727090 65 1588548 30
355359061686 7 574982464449 19
18229 50 175320 42
2742779 108 2351290 125
1842377 65 1598772 76
580991685272 57 940063283058 61
1793655 72 1559510 82
920394 91 117882 125
1236010 78 1915117 50
2763483 114 2775839 114
145...

output:

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

result:

ok 250000 token(s): yes count is 125954, no count is 124046

Test #106:

score: 20
Accepted
time: 2451ms
memory: 36352kb

input:

29989 250000
209403 125 1471279 83
2338875 125 3031882 102
190046233396 112 534308060166 75
957345 12 389854 31
535191537827 88 970223055772 75
1319058 98 2968906 43
179870 125 1671722 76
1780178 125 2488763 102
2193624 125 3148496 94
667065 125 1588390 95
479787 124 1256490 99
1588743 32 967963 53
...

output:

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

result:

ok 250000 token(s): yes count is 126858, no count is 123142

Test #107:

score: 20
Accepted
time: 944ms
memory: 18604kb

input:

24242 250000
609767017923 38 986623073214 41
183864216002 125 297497815516 96
370088953525 96 598818479876 9
465421886852 41 753068641469 20
526276423436 29 851530156524 94
357322673336 52 578160471158 26
437852785041 19 708456794956 111
176151581992 31 285018664708 34
661144498186 80 666999189776 2...

output:

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

result:

ok 250000 token(s): yes count is 164988, no count is 85012

Test #108:

score: 20
Accepted
time: 1274ms
memory: 22560kb

input:

30000 250000
197975280726 6 320326350291 94
214266087860 16 346687962825 48
266943637221 37 431924745399 5
330124306148 76 534149482512 106
557782303750 122 902511667493 56
544994592002 103 881818203606 96
162790399194 11 263397865018 59
539659235926 95 873188137135 35
355130451284 92 574612308582 7...

output:

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

result:

ok 250000 token(s): yes count is 164439, no count is 85561

Test #109:

score: 20
Accepted
time: 268ms
memory: 7164kb

input:

4711 250000
374195889198 85 605462059985 1
518604197654 76 839118654219 121
347752748354 11 562674880764 123
291437993839 80 471556133288 108
459369276568 48 743274460030 114
68464161633 2 110777052676 39
616838081717 55 998064432886 106
12777781379 26 20674641174 48
224682658333 81 363543972519 77
...

output:

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

result:

ok 250000 token(s): yes count is 166416, no count is 83584

Test #110:

score: 20
Accepted
time: 118ms
memory: 3764kb

input:

42 250000
879145256308 102 36788558862 106
427386210929 74 691525417558 17
299652343581 46 484847672062 97
403458626363 66 652809771787 22
297670624741 104 481641190681 29
405906363944 53 656770291599 55
442319059526 107 715687275999 10
40152830155 12 64968642197 33
520219445309 75 841732745977 19
3...

output:

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

result:

ok 250000 token(s): yes count is 168719, no count is 81281

Test #111:

score: 20
Accepted
time: 1776ms
memory: 27868kb

input:

29950 250000
264648961265 8 428210381732 18
425765673757 53 688904579511 7
435597131634 4 704809533462 32
242245238731 34 391961805879 5
383862692222 108 621106020708 2
414025823248 8 669906688492 29
263723531187 28 426714184933 6
305266496104 85 493931882907 46
2336569 47 29945 125
186222486952 59 ...

output:

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

result:

ok 250000 token(s): yes count is 130602, no count is 119398

Test #112:

score: 20
Accepted
time: 954ms
memory: 18680kb

input:

29989 250000
361522547066 91 584958449328 1
240996271865 2 389935706358 93
264653321716 8 428215010105 68
263379336124 7 426151881291 104
586633217023 1 949187710263 99
263312848966 7 426043526438 120
427116531223 104 691091795346 8
2938682 28 59718 125
250523580752 3 405353332446 50
269074094524 13...

output:

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

result:

ok 250000 token(s): yes count is 131418, no count is 118582

Test #113:

score: 20
Accepted
time: 49ms
memory: 3812kb

input:

2 250000
75 16 56 55
50 9 49 60
18 67 62 5
30 54 61 39
22 39 42 31
26 30 55 1
23 30 53 16
55 13 6 44
69 8 58 72
53 7 60 12
29 14 26 34
37 64 24 71
19 3 40 1
64 13 33 65
67 24 68 3
64 17 50 66
71 6 62 13
15 29 26 24
51 30 34 45
46 5 40 72
54 52 60 49
35 21 18 30
39 31 35 34
30 74 72 5
74 12 6 15
11 4...

output:

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

result:

ok 250000 token(s): yes count is 122161, no count is 127839

Test #114:

score: 20
Accepted
time: 986ms
memory: 18824kb

input:

29876 250000
258189476951 35 417758848013 32
441632920302 121 714576339961 90
3225803 113 3405860 107
527795966824 118 853993550221 37
274175769806 90 443625406174 62
443038098441 119 716849761177 93
3166167 99 2987598 105
3375445 89 2688839 112
2359828 118 3555243 78
574833973466 73 930100284161 58...

output:

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

result:

ok 250000 token(s): yes count is 99981, no count is 150019

Test #115:

score: 20
Accepted
time: 46ms
memory: 3812kb

input:

7 250000
14 72 33 41
43 64 63 62
34 14 69 9
19 75 21 57
47 6 43 53
19 53 58 46
50 49 49 74
30 75 53 68
36 42 53 14
70 40 52 73
70 44 75 44
38 75 72 46
11 45 20 10
25 67 35 60
54 27 14 28
53 35 26 44
10 20 60 13
61 2 41 6
54 3 66 8
43 34 69 31
52 16 3 41
53 62 33 66
15 75 27 32
73 22 22 44
66 15 56 1...

output:

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

result:

ok 250000 token(s): yes count is 123236, no count is 126764

Test #116:

score: 20
Accepted
time: 51ms
memory: 3700kb

input:

42 250000
9 44 75 43
56 10 46 11
25 22 40 22
54 4 49 5
4 22 34 16
69 59 72 59
66 75 74 31
5 10 57 10
11 48 36 46
7 40 56 14
32 68 5 74
66 25 59 40
10 6 20 7
48 25 73 24
54 41 51 56
71 32 47 55
17 3 26 10
20 49 8 51
44 17 43 35
75 18 69 33
72 8 74 43
45 75 66 19
56 73 68 15
47 56 57 57
39 69 20 70
7 ...

output:

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

result:

ok 250000 token(s): yes count is 118956, no count is 131044

Test #117:

score: 20
Accepted
time: 49ms
memory: 3756kb

input:

74 250000
29 38 74 53
17 75 67 32
10 17 14 74
7 35 60 74
18 61 33 14
11 75 47 46
5 66 54 57
11 19 38 35
45 1 66 51
3 57 71 35
48 75 59 48
75 75 75 65
51 54 15 57
6 11 25 65
10 6 36 4
43 29 34 36
32 75 19 59
11 11 41 39
19 55 36 74
44 1 69 2
11 49 39 30
62 75 49 14
47 5 53 71
7 60 38 34
48 75 11 43
7...

output:

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

result:

ok 250000 token(s): yes count is 107243, no count is 142757

Test #118:

score: 20
Accepted
time: 48ms
memory: 3840kb

input:

33 250000
42 63 17 64
48 31 9 35
46 64 75 15
42 14 16 17
3 37 49 15
70 39 16 43
52 2 8 8
12 12 57 9
36 42 75 1
9 60 30 58
47 71 75 69
75 7 3 30
45 51 24 52
14 15 2 25
55 35 2 53
68 32 31 34
69 43 56 45
44 68 75 57
29 36 2 55
56 61 5 71
36 55 75 21
38 73 75 69
61 72 75 24
67 10 74 10
48 28 28 30
47 6...

output:

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

result:

ok 250000 token(s): yes count is 115599, no count is 134401

Test #119:

score: 20
Accepted
time: 43ms
memory: 3756kb

input:

20 250000
24 13 65 12
8 13 74 5
13 68 67 65
70 58 55 60
54 39 30 41
75 45 20 72
1 27 55 0
4 35 75 18
2 48 75 21
49 70 54 71
9 25 75 37
75 8 72 72
74 0 17 3
1 51 34 18
8 7 28 5
66 13 34 16
65 2 58 3
3 45 49 33
33 15 70 13
53 36 75 6
15 75 55 72
7 0 64 74
75 30 21 55
75 4 39 65
67 21 75 9
47 22 20 23
...

output:

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

result:

ok 250000 token(s): yes count is 118095, no count is 131905

Test #120:

score: 20
Accepted
time: 51ms
memory: 3760kb

input:

10 250000
50 31 58 32
17 66 46 63
8 39 35 36
75 42 49 64
28 68 75 9
3 73 10 71
64 54 23 58
33 32 16 35
8 31 63 24
51 7 75 65
60 11 38 15
12 75 75 3
4 52 28 45
24 54 2 71
44 39 24 42
46 41 75 4
1 39 74 3
75 9 41 48
75 9 61 72
58 44 74 42
66 34 28 38
64 30 72 29
34 46 62 44
75 6 17 68
29 16 1 45
63 38...

output:

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

result:

ok 250000 token(s): yes count is 123426, no count is 126574

Test #121:

score: 20
Accepted
time: 45ms
memory: 3836kb

input:

3 250000
44 27 71 1
61 15 13 29
48 7 36 37
23 71 28 11
39 10 14 6
24 64 39 29
48 28 23 58
22 14 34 64
36 55 29 45
5 55 69 38
56 48 56 63
67 61 24 44
38 6 47 38
3 22 6 59
7 71 4 41
34 8 55 63
53 56 43 7
5 51 5 75
53 72 8 14
40 37 42 14
58 19 70 50
71 13 56 52
42 12 37 62
73 19 58 24
64 63 46 64
46 31...

output:

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

result:

ok 250000 token(s): yes count is 130142, no count is 119858

Subtask #7:

score: 15
Accepted

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Dependency #4:

100%
Accepted

Dependency #5:

100%
Accepted

Dependency #6:

100%
Accepted

Test #122:

score: 15
Accepted
time: 81ms
memory: 3756kb

input:

1 250000
554333015044 833858497873 833858497874 554333015044
655160857180 306396306924 306396306917 655160857187
374728598365 176680698490 176680698490 374728598365
764650258714 835600427315 835600427309 764650258720
521594231110 318048536486 318048536482 521594231115
273627794040 449769302710 10899...

output:

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

result:

ok 250000 token(s): yes count is 126293, no count is 123707

Test #123:

score: 15
Accepted
time: 53ms
memory: 3684kb

input:

33 250000
42 63 17 64
48 31 9 35
46 64 75 15
42 14 16 17
3 37 49 15
70 39 16 43
52 2 8 8
12 12 57 9
36 42 75 1
9 60 30 58
47 71 75 69
75 7 3 30
45 51 24 52
14 15 2 25
55 35 2 53
68 32 31 34
69 43 56 45
44 68 75 57
29 36 2 55
56 61 5 71
36 55 75 21
38 73 75 69
61 72 75 24
67 10 74 10
48 28 28 30
47 6...

output:

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

result:

ok 250000 token(s): yes count is 115599, no count is 134401

Test #124:

score: 15
Accepted
time: 49ms
memory: 3756kb

input:

20 250000
24 13 65 12
8 13 74 5
13 68 67 65
70 58 55 60
54 39 30 41
75 45 20 72
1 27 55 0
4 35 75 18
2 48 75 21
49 70 54 71
9 25 75 37
75 8 72 72
74 0 17 3
1 51 34 18
8 7 28 5
66 13 34 16
65 2 58 3
3 45 49 33
33 15 70 13
53 36 75 6
15 75 55 72
7 0 64 74
75 30 21 55
75 4 39 65
67 21 75 9
47 22 20 23
...

output:

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

result:

ok 250000 token(s): yes count is 118095, no count is 131905

Test #125:

score: 15
Accepted
time: 48ms
memory: 3704kb

input:

10 250000
50 31 58 32
17 66 46 63
8 39 35 36
75 42 49 64
28 68 75 9
3 73 10 71
64 54 23 58
33 32 16 35
8 31 63 24
51 7 75 65
60 11 38 15
12 75 75 3
4 52 28 45
24 54 2 71
44 39 24 42
46 41 75 4
1 39 74 3
75 9 41 48
75 9 61 72
58 44 74 42
66 34 28 38
64 30 72 29
34 46 62 44
75 6 17 68
29 16 1 45
63 38...

output:

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

result:

ok 250000 token(s): yes count is 123426, no count is 126574

Test #126:

score: 15
Accepted
time: 30ms
memory: 3700kb

input:

3 250000
44 27 71 1
61 15 13 29
48 7 36 37
23 71 28 11
39 10 14 6
24 64 39 29
48 28 23 58
22 14 34 64
36 55 29 45
5 55 69 38
56 48 56 63
67 61 24 44
38 6 47 38
3 22 6 59
7 71 4 41
34 8 55 63
53 56 43 7
5 51 5 75
53 72 8 14
40 37 42 14
58 19 70 50
71 13 56 52
42 12 37 62
73 19 58 24
64 63 46 64
46 31...

output:

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

result:

ok 250000 token(s): yes count is 130142, no count is 119858

Test #127:

score: 15
Accepted
time: 57ms
memory: 3820kb

input:

3 250000
266 36 105 90
207 149 109 198
246 93 275 84
12 300 16 299
292 6 137 73
20 300 242 227
1 300 107 245
269 148 177 179
90 300 114 292
254 152 191 173
271 25 223 82
92 133 72 140
227 72 30 138
50 94 285 16
211 60 2 165
11 4 9 5
15 106 290 15
96 26 29 49
299 139 2 288
258 233 58 300
2 92 180 4
2...

output:

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

result:

ok 250000 token(s): yes count is 122039, no count is 127961

Test #128:

score: 15
Accepted
time: 52ms
memory: 3816kb

input:

7 250000
253 123 35 260
296 180 68 288
181 141 2 231
22 300 105 71
134 271 52 300
22 184 191 172
195 279 62 299
36 125 181 93
125 300 215 240
101 36 296 10
2 196 275 60
215 144 190 300
150 104 127 191
132 102 56 113
109 206 85 234
27 41 24 42
84 286 122 201
261 282 139 300
90 31 19 42
62 42 98 37
15...

output:

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

result:

ok 250000 token(s): yes count is 116187, no count is 133813

Test #129:

score: 15
Accepted
time: 63ms
memory: 3844kb

input:

70 250000
113 275 266 273
134 300 177 202
290 217 109 230
230 62 235 62
173 272 267 271
130 99 233 72
73 91 299 88
159 300 172 286
198 134 113 136
280 48 96 300
299 91 271 92
133 143 51 145
128 120 130 120
123 180 2 300
139 265 161 213
231 94 6 132
270 233 4 300
134 228 179 228
2 246 165 165
244 14 ...

output:

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

result:

ok 250000 token(s): yes count is 123982, no count is 126018

Test #130:

score: 15
Accepted
time: 39ms
memory: 3824kb

input:

299 250000
277 284 19 298
177 147 109 148
101 300 152 190
183 235 168 300
93 116 257 46
242 300 245 136
88 300 184 298
94 191 26 194
273 41 10 273
53 172 139 171
134 262 83 263
99 211 194 300
167 130 90 212
2 260 105 209
171 167 145 300
151 247 94 248
227 127 59 213
35 10 197 6
52 66 226 225
297 300...

output:

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

result:

ok 250000 token(s): yes count is 109302, no count is 140698

Test #131:

score: 15
Accepted
time: 42ms
memory: 3684kb

input:

300 250000
137 295 278 80
5 281 84 152
153 300 104 145
244 36 196 132
95 300 243 109
118 26 105 29
176 3 178 135
123 166 78 286
199 232 16 300
97 174 162 150
72 274 122 36
81 271 31 273
239 107 60 300
9 282 16 40
250 13 239 144
116 199 20 245
181 183 88 300
28 204 259 196
156 195 253 195
177 259 39 ...

output:

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

result:

ok 250000 token(s): yes count is 105672, no count is 144328

Test #132:

score: 15
Accepted
time: 53ms
memory: 3780kb

input:

99 250000
257 74 300 26
114 83 300 1
157 243 300 1
242 119 85 121
83 148 300 59
201 1 147 2
35 72 117 71
194 209 3 272
157 139 201 139
295 0 126 2
130 7 1 137
29 68 183 64
165 1 193 1
290 0 201 1
98 259 46 261
134 1 178 1
110 2 237 1
96 17 300 130
144 34 2 87
272 1 297 2
174 0 71 1
263 0 25 1
125 98...

output:

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

result:

ok 250000 token(s): yes count is 152693, no count is 97307

Test #133:

score: 15
Accepted
time: 99ms
memory: 3684kb

input:

1 250000
129596328651 633211431893 1 762807760544
1 983509496641 151077576062 229908055916
36498040145 186033440917 1 995620003790
247250323075 720548396611 720548396605 247250323082
464252981836 491098062545 12027035640 943324008741
719683599156 92798217394 1 812481816550
317330065824 621406415744 ...

output:

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

result:

ok 250000 token(s): yes count is 143356, no count is 106644

Test #134:

score: 15
Accepted
time: 59ms
memory: 3864kb

input:

142 250000
8 192 121 180
93 243 9 253
256 220 300 1
129 130 2 194
246 204 226 205
174 2 272 1
223 130 24 138
57 264 280 260
146 231 300 9
64 238 45 239
248 199 111 200
2 250 191 179
191 2 299 1
163 70 186 70
143 35 300 1
55 287 300 150
2 276 224 188
61 217 300 28
2 159 142 95
277 254 300 1
180 0 272...

output:

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

result:

ok 250000 token(s): yes count is 135315, no count is 114685

Test #135:

score: 15
Accepted
time: 58ms
memory: 3696kb

input:

10 250000
140 238 213 15
209 29 275 205
7 3 39 0
267 152 14 81
295 282 40 1
236 73 164 97
198 10 165 172
155 223 30 9
275 3 33 27
72 203 162 6
269 131 161 179
286 115 2 236
183 186 151 107
113 222 2 211
289 64 188 256
149 236 53 110
218 212 103 158
123 42 13 97
242 26 266 24
30 20 204 3
268 97 286 2...

output:

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

result:

ok 250000 token(s): yes count is 165023, no count is 84977

Test #136:

score: 15
Accepted
time: 50ms
memory: 3820kb

input:

15 250000
140 238 213 15
209 29 275 205
20 2 38 1
267 152 14 81
295 282 40 1
236 73 164 97
198 10 165 172
155 223 30 9
202 2 33 13
72 203 162 6
269 131 161 179
286 115 2 236
183 186 151 107
113 222 2 211
289 64 188 256
149 236 53 110
218 212 103 158
208 157 112 97
26 18 275 1
166 13 206 11
268 97 28...

output:

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

result:

ok 250000 token(s): yes count is 162083, no count is 87917

Test #137:

score: 15
Accepted
time: 1ms
memory: 3748kb

input:

2 1
1000000000000 0 1 1000000000000

output:

NO

result:

ok NO

Test #138:

score: 15
Accepted
time: 42ms
memory: 3780kb

input:

42 250000
800 31 1306 19
763 6 291 18
1402 19 822 33
1183 25 1082 28
1636 34 1439 38
1997 1 76 47
1546 41 1735 36
1911 9 396 45
65 23 983 1
1842 20 841 43
757 7 321 18
558 32 1381 13
383 18 790 9
149 40 1682 3
1827 35 1486 43
87 44 1886 2
842 17 745 20
918 31 1329 21
1807 22 958 43
1125 22 944 26
14...

output:

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

result:

ok 250000 token(s): yes count is 236890, no count is 13110

Test #139:

score: 15
Accepted
time: 51ms
memory: 3940kb

input:

300 250000
522 0 286 1
95 6 1961 0
1747 4 1466 5
1475 3 1013 4
1864 5 1547 6
1652 3 1066 5
1655 3 1022 5
744 1 412 2
1723 6 1949 5
78 1 529 0
839 4 1273 2
1244 6 1963 4
872 6 1816 2
1451 6 1811 4
1244 5 1780 4
1897 1 415 6
1781 0 260 5
1631 5 1743 5
1888 0 15 6
243 5 1685 0
338 0 277 1
1385 3 943 4
...

output:

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

result:

ok 250000 token(s): yes count is 197405, no count is 52595

Test #140:

score: 15
Accepted
time: 66ms
memory: 3876kb

input:

342 250000
408 1209 111 2000
1902 1357 688 2000
1691 1272 471 1464
1385 1170 2 1862
508 1011 1329 672
1374 527 788 2000
31 2000 893 1002
983 267 616 269
112 2000 521 1997
1729 865 976 868
1190 2000 1373 1987
647 2000 1639 1941
1266 1978 56 2000
3 1771 1669 1216
857 1141 410 1143
803 1101 897 108
401...

output:

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

result:

ok 250000 token(s): yes count is 124862, no count is 125138

Test #141:

score: 15
Accepted
time: 67ms
memory: 3756kb

input:

4 250000
36 373 1491 10
1163 2000 1936 1807
643 2000 1195 1862
1175 1938 935 1999
415 131 112 207
1603 1603 18 2000
259 2000 424 1959
1754 1892 1324 2000
1392 2000 1493 1975
976 1987 927 2000
91 1965 2 2000
1820 1934 1560 2000
204 2000 1036 1793
1419 1695 200 2000
1613 1834 952 2000
1 2000 175 1827
...

output:

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

result:

ok 250000 token(s): yes count is 124125, no count is 125875

Test #142:

score: 15
Accepted
time: 63ms
memory: 3896kb

input:

81 250000
594 2000 727 1697
337 6 51 12
2 1794 879 1356
1452 9 747 18
169 2000 1504 1984
1780 1992 1197 2000
1536 1999 1714 1997
59 16 981 1
540 2000 1939 1983
396 1615 1461 648
2 1942 753 1567
1496 1981 78 2000
486 2000 1917 1983
1699 12 1038 21
76 22 113 22
726 2000 1313 1993
1933 1128 3 2000
349 ...

output:

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

result:

ok 250000 token(s): yes count is 124416, no count is 125584

Test #143:

score: 15
Accepted
time: 92ms
memory: 3888kb

input:

399 250000
117973238523 513024052169 940125144496 510963521077
811297510904 497712169401 278621951769 499047195865
133838753727 833818856 188964221803 695659789
616511136507 989212710127 902399529842 988496197864
666566505255 1688066378 673538485220 1670592745
31923976042 345406452672 319754582069 3...

output:

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

result:

ok 250000 token(s): yes count is 125215, no count is 124785

Test #144:

score: 15
Accepted
time: 90ms
memory: 3688kb

input:

1 250000
807680045522 377273608557 256372130241 928581523838
536035116725 716237980103 379308294473 872964802356
1 882064014033 529720193901 352343820133
80961796479 258174541326 183165451143 155970886662
739448494904 100650373373 75082626963 765016241315
166426307909 865864146065 703399919607 32889...

output:

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

result:

ok 250000 token(s): yes count is 132783, no count is 117217

Test #145:

score: 15
Accepted
time: 86ms
memory: 3900kb

input:

397 250000
618442278236 882930407286 123797985649 884176362683
119166282089 188951143685 144 189778687310
249270498241 536986738793 169736862881 537187075406
162812939519 1999693300 414854688874 1364827433
41 1026949255 14334704114 677322327
333340873334 897924928447 225790703819 898195835675
604305...

output:

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

result:

ok 250000 token(s): yes count is 124605, no count is 125395

Test #146:

score: 15
Accepted
time: 97ms
memory: 3804kb

input:

196 250000
184778767653 724988347336 436828838936 723702377585
135665813919 540416702272 755059942224 537256528148
39105602872 920750486095 844898928719 916639295658
3996332306 550857227597 297542203728 549359544580
260448198835 927504024272 906265607520 924209037493
477476523943 813127345942 103770...

output:

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

result:

ok 250000 token(s): yes count is 125095, no count is 124905

Test #147:

score: 15
Accepted
time: 85ms
memory: 3688kb

input:

55 250000
274869231615 9092091213 81467836449 12608480217
905294302640 827591316673 732993268589 830724062747
509115780084 3110922106 171100715853 9256650547
8 663525628389 13175563438 661776266046
570316343025 746946171603 315626558334 751576894962
522801071055 62091957030 2 361081982370
9938409784...

output:

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

result:

ok 250000 token(s): yes count is 124912, no count is 125088

Test #148:

score: 15
Accepted
time: 86ms
memory: 3768kb

input:

30 250000
221258298107 351381514381 9 377943598488
760034554499 242670793277 256537339854 259454033766
541154529479 744128857052 34587880477 761014412019
15 31835419290 66562155496 27303114772
795868470600 855783375078 9550703549 881993967314
288214719569 606125536029 2603067931 615645924417
3464407...

output:

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

result:

ok 250000 token(s): yes count is 126028, no count is 123972

Test #149:

score: 15
Accepted
time: 91ms
memory: 3836kb

input:

7 250000
986464353782 9454938530 98000946639 138114393063
25897421993 446144089611 1 483098871270
3 281360159163 206359344706 213762916752
546527727801 820699776936 403800284041 841089411759
17650286094 126635860313 433379762058 67245935176
744543254112 611730074572 62341575022 709187457300
37856477...

output:

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

result:

ok 250000 token(s): yes count is 125281, no count is 124719

Test #150:

score: 15
Accepted
time: 55ms
memory: 3840kb

input:

400 250000
151228 0 399 379
84432 2 1199 211
98829 3 1599 247
353621 1 799 884
52610 3 1599 131
41183 0 399 103
134469 0 399 337
169997 1 799 425
350781 1 799 877
292151 0 399 732
195911 0 399 491
188814 3 1599 472
372008 3 1599 930
125608 2 1199 314
108006 3 1599 270
100902 3 1599 252
108551 0 399 ...

output:

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

result:

ok 250000 token(s): yes count is 125000, no count is 125000

Test #151:

score: 15
Accepted
time: 53ms
memory: 3840kb

input:

400 250000
151228 0 399 379
84432 2 1199 211
98829 3 1599 247
353621 1 799 884
52610 3 1599 131
41183 0 399 103
134469 0 399 337
169997 1 799 425
350781 1 799 877
292151 0 399 732
195911 0 399 491
188814 3 1599 472
372008 3 1599 930
125608 2 1199 314
108006 3 1599 270
100902 3 1599 252
108551 0 399 ...

output:

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

result:

ok 250000 token(s): yes count is 125000, no count is 125000

Test #152:

score: 15
Accepted
time: 94ms
memory: 3720kb

input:

42 250000
528133021628 877123441407 301254101993 77752117206
988511224716 338531611908 501193999197 187726824151
198354202042 138031889915 35062152723 885207065024
31895539568 108768653867 5306730504 968707601307
893469548022 301611733696 922647012155 170145752730
250350966289 802128707128 212116047...

output:

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

result:

ok 250000 token(s): yes count is 125334, no count is 124666

Test #153:

score: 15
Accepted
time: 95ms
memory: 3884kb

input:

142 250000
558089164124 448677664740 498149663092 980742085170
721 119622290215 118 119622290220
55286012184 776688000114 48081586476 784668171345
351446210665 1 568651912607 7
441547723834 975517758473 888937495689 509174740626
132 786460804875 1308 786460804867
638132286892 438621919405 7764975804...

output:

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

result:

ok 250000 token(s): yes count is 124682, no count is 125318

Test #154:

score: 15
Accepted
time: 147ms
memory: 4068kb

input:

300 250000
35539 31102416099 299 31102416217
26605 404096600351 299 404096600439
299 234409574874 12101 234409574835
314626867021 2 509076961816 7
261 277573598158 748 277573598157
8235 6160919498 298 6160919525
518195275945 8 838457569747 4
317456659770 1 513655662365 7
294 77256485799 8453 7725648...

output:

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

result:

ok 250000 token(s): yes count is 125000, no count is 125000

Test #155:

score: 15
Accepted
time: 1ms
memory: 3832kb

input:

1 1
999999999999 999999999999 999999999999 999999999999

output:

YES

result:

ok YES

Test #156:

score: 15
Accepted
time: 166ms
memory: 3780kb

input:

399 250000
279594328175 77561 452423817232 396
279594327776 64326 452418536467 395
452429618692 396 731987198568 92101
279594328574 53330 452414149063 397
452427773716 397 731987198967 87477
452424021919 394 731987197770 78074
279594326978 36482 452407426711 393
452417991433 397 731987198967 62960
4...

output:

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

result:

ok 250000 token(s): yes count is 127634, no count is 122366

Test #157:

score: 15
Accepted
time: 98ms
memory: 3960kb

input:

300 250000
772557904799 327286037294 391912683600 328554854698
995121117000 346402149815 628189556676 347625255017
729951499800 854196290983 289928908248 855663032955
97013284500 458196268400 98022671099 458192903779
501960891899 760564166756 562845012000 760361219689
479036861782 654854780091 39899...

output:

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

result:

ok 250000 token(s): yes count is 124342, no count is 125658

Test #158:

score: 15
Accepted
time: 66ms
memory: 3856kb

input:

396 250000
46331 33238006 2765 33238117
46331 16537062 2765 16537173
46331 3867997 2765 3868108
46331 33287533 2765 33287644
46331 33292889 2765 33293000
46331 3863273 2765 3863384
46331 3821963 2765 3822074
46331 33258407 2765 33258518
46331 7994813 2765 7994924
46331 33241889 2765 33242000
46331 3...

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

result:

ok 250000 token(s): yes count is 14943, no count is 235057

Test #159:

score: 15
Accepted
time: 54ms
memory: 3740kb

input:

2000 250000
1019 1670 635 2000
660 2000 988 1703
684 72 1518 98
529 1994 80 2000
1908 1218 528 1221
1106 632 1783 679
189 192 1134 1874
1343 421 513 423
379 2000 992 1211
795 1281 1815 1280
1614 1461 1883 1189
795 1600 276 2000
102 1370 918 807
1654 1316 1055 2000
299 7 1972 1994
453 738 1185 737
13...

output:

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

result:

ok 250000 token(s): yes count is 106884, no count is 143116

Test #160:

score: 15
Accepted
time: 67ms
memory: 3896kb

input:

1042 250000
1652 487 1949 487
314 1904 422 1904
1603 1999 1481 2000
2 1930 1519 1172
1707 355 2 1208
1498 1777 1364 2000
1597 1999 1937 1534
1435 1961 1792 1961
1237 2000 1346 971
543 1055 587 1056
1082 1886 1367 1409
1093 2000 1552 1252
1637 1998 1094 2000
1650 487 1239 488
1253 1999 1343 1878
1228...

output:

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

result:

ok 250000 token(s): yes count is 124749, no count is 125251

Test #161:

score: 15
Accepted
time: 76ms
memory: 4036kb

input:

499 250000
2 1881 1997 98
1123 2000 1525 1885
1351 1939 374 1942
514 1994 1184 1993
1231 945 1124 2000
4 2000 1451 1632
1446 392 854 1164
1139 1773 1377 1773
2 1915 1083 1375
1157 2000 1577 1999
2 1886 1951 912
1444 1894 1530 969
1129 1987 609 1989
1289 1737 1930 1736
801 2000 1896 1543
2 1017 1767 ...

output:

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

result:

ok 250000 token(s): yes count is 124920, no count is 125080

Test #162:

score: 15
Accepted
time: 67ms
memory: 4052kb

input:

1337 250000
381 1 1816 0
1582 0 203 1
1493 0 437 1
1828 0 146 1
1477 0 345 1
1943 0 219 1
418 1 1919 0
375 1 1959 0
1527 1 1991 1
1584 0 792 1
1890 0 1151 1
1340 1 1673 1
1435 0 367 1
1346 0 526 1
1818 0 347 1
1699 0 176 1
1619 0 361 1
1905 0 253 1
196 1 1748 0
1559 0 151 1
1660 0 674 1
1897 0 134 1...

output:

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

result:

ok 250000 token(s): yes count is 174050, no count is 75950

Test #163:

score: 15
Accepted
time: 61ms
memory: 3824kb

input:

75 250000
1849 418 1349 425
1949 607 1998 607
1775 1646 1349 1652
1775 1934 1349 1940
1349 1118 1701 1114
1424 678 1997 671
1849 643 1724 645
1627 1494 1724 1493
1724 1291 1849 1290
1949 1880 1627 1885
1724 770 1923 768
1849 460 1499 465
1997 420 1499 427
1349 1899 1627 1896
1874 1961 1997 1960
1701...

output:

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

result:

ok 250000 token(s): yes count is 126447, no count is 123553

Test #164:

score: 15
Accepted
time: 75ms
memory: 3776kb

input:

42 250000
4872 44 1889 116
2940 47 1989 70
3401 74 3146 81
629 27 988 19
2765 125 4409 86
2056 125 4578 65
4953 9 118 125
486576003099 110 843475701009 97
5078 105 4242 125
121 70 71 72
313361668603 101 507029830192 68
3570 94 2302 125
808028848732 24 964525600627 54
3276 39 1670 78
1436 115 1049 12...

output:

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

result:

ok 250000 token(s): yes count is 127583, no count is 122417

Test #165:

score: 15
Accepted
time: 378ms
memory: 9560kb

input:

4711 250000
569918431634 39 857108209284 1
188255 96 456963 39
479796256308 10 776325805652 117
395721 123 522634 97
18816 125 542401 14
514919 125 584134 111
79935 87 414560 16
437225268144 123 707445756354 22
339146 125 382570 116
537029 71 337451 114
61176 125 143828 108
256751 57 3742 125
320316...

output:

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

result:

ok 250000 token(s): yes count is 128340, no count is 121660

Test #166:

score: 15
Accepted
time: 0ms
memory: 3684kb

input:

17 2
42 1 33 1
42 1 33 7

output:

YES
NO

result:

ok 2 token(s): yes count is 1, no count is 1

Test #167:

score: 15
Accepted
time: 2021ms
memory: 30756kb

input:

24242 250000
1624048 109 2648467 67
3030067 88 2141356 125
727090 65 1588548 30
355359061686 7 574982464449 19
18229 50 175320 42
2742779 108 2351290 125
1842377 65 1598772 76
580991685272 57 940063283058 61
1793655 72 1559510 82
920394 91 117882 125
1236010 78 1915117 50
2763483 114 2775839 114
145...

output:

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

result:

ok 250000 token(s): yes count is 125954, no count is 124046

Test #168:

score: 15
Accepted
time: 2553ms
memory: 36360kb

input:

29989 250000
209403 125 1471279 83
2338875 125 3031882 102
190046233396 112 534308060166 75
957345 12 389854 31
535191537827 88 970223055772 75
1319058 98 2968906 43
179870 125 1671722 76
1780178 125 2488763 102
2193624 125 3148496 94
667065 125 1588390 95
479787 124 1256490 99
1588743 32 967963 53
...

output:

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

result:

ok 250000 token(s): yes count is 126858, no count is 123142

Test #169:

score: 15
Accepted
time: 966ms
memory: 18676kb

input:

24242 250000
609767017923 38 986623073214 41
183864216002 125 297497815516 96
370088953525 96 598818479876 9
465421886852 41 753068641469 20
526276423436 29 851530156524 94
357322673336 52 578160471158 26
437852785041 19 708456794956 111
176151581992 31 285018664708 34
661144498186 80 666999189776 2...

output:

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

result:

ok 250000 token(s): yes count is 164988, no count is 85012

Test #170:

score: 15
Accepted
time: 1266ms
memory: 22616kb

input:

30000 250000
197975280726 6 320326350291 94
214266087860 16 346687962825 48
266943637221 37 431924745399 5
330124306148 76 534149482512 106
557782303750 122 902511667493 56
544994592002 103 881818203606 96
162790399194 11 263397865018 59
539659235926 95 873188137135 35
355130451284 92 574612308582 7...

output:

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

result:

ok 250000 token(s): yes count is 164439, no count is 85561

Test #171:

score: 15
Accepted
time: 267ms
memory: 7220kb

input:

4711 250000
374195889198 85 605462059985 1
518604197654 76 839118654219 121
347752748354 11 562674880764 123
291437993839 80 471556133288 108
459369276568 48 743274460030 114
68464161633 2 110777052676 39
616838081717 55 998064432886 106
12777781379 26 20674641174 48
224682658333 81 363543972519 77
...

output:

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

result:

ok 250000 token(s): yes count is 166416, no count is 83584

Test #172:

score: 15
Accepted
time: 120ms
memory: 3840kb

input:

42 250000
879145256308 102 36788558862 106
427386210929 74 691525417558 17
299652343581 46 484847672062 97
403458626363 66 652809771787 22
297670624741 104 481641190681 29
405906363944 53 656770291599 55
442319059526 107 715687275999 10
40152830155 12 64968642197 33
520219445309 75 841732745977 19
3...

output:

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

result:

ok 250000 token(s): yes count is 168719, no count is 81281

Test #173:

score: 15
Accepted
time: 1828ms
memory: 28028kb

input:

29950 250000
264648961265 8 428210381732 18
425765673757 53 688904579511 7
435597131634 4 704809533462 32
242245238731 34 391961805879 5
383862692222 108 621106020708 2
414025823248 8 669906688492 29
263723531187 28 426714184933 6
305266496104 85 493931882907 46
2336569 47 29945 125
186222486952 59 ...

output:

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

result:

ok 250000 token(s): yes count is 130602, no count is 119398

Test #174:

score: 15
Accepted
time: 930ms
memory: 18608kb

input:

29989 250000
361522547066 91 584958449328 1
240996271865 2 389935706358 93
264653321716 8 428215010105 68
263379336124 7 426151881291 104
586633217023 1 949187710263 99
263312848966 7 426043526438 120
427116531223 104 691091795346 8
2938682 28 59718 125
250523580752 3 405353332446 50
269074094524 13...

output:

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

result:

ok 250000 token(s): yes count is 131418, no count is 118582

Test #175:

score: 15
Accepted
time: 913ms
memory: 18692kb

input:

29876 250000
258189476951 35 417758848013 32
441632920302 121 714576339961 90
3225803 113 3405860 107
527795966824 118 853993550221 37
274175769806 90 443625406174 62
443038098441 119 716849761177 93
3166167 99 2987598 105
3375445 89 2688839 112
2359828 118 3555243 78
574833973466 73 930100284161 58...

output:

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

result:

ok 250000 token(s): yes count is 99981, no count is 150019

Test #176:

score: 15
Accepted
time: 96ms
memory: 4040kb

input:

1337 250000
620 597342892 225379946030 233949679
263930882631 150832340320 49700703436 150992572317
582888873728 548331405 733119089821 435967744
44029647825 611766119192 274589494987 38535847368
310962961603 828432563324 707847547530 828135716215
922423655019 125735940004 639534705222 125947524858
...

output:

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

result:

ok 250000 token(s): yes count is 125172, no count is 124828

Test #177:

score: 15
Accepted
time: 45ms
memory: 3676kb

input:

2 250000
75 16 56 55
50 9 49 60
18 67 62 5
30 54 61 39
22 39 42 31
26 30 55 1
23 30 53 16
55 13 6 44
69 8 58 72
53 7 60 12
29 14 26 34
37 64 24 71
19 3 40 1
64 13 33 65
67 24 68 3
64 17 50 66
71 6 62 13
15 29 26 24
51 30 34 45
46 5 40 72
54 52 60 49
35 21 18 30
39 31 35 34
30 74 72 5
74 12 6 15
11 4...

output:

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

result:

ok 250000 token(s): yes count is 122161, no count is 127839

Test #178:

score: 15
Accepted
time: 124ms
memory: 4680kb

input:

4711 250000
296815527999 711202965505 470579858490 711166080697
772065579810 512614625333 193275336477 512737484651
512368199825 3063966928 910806762819 2979390711
596221493574 624373839025 586418350118 624375919931
975599294039 193425657 911228274831 207089640
380922551498 989997726742 767554057683...

output:

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

result:

ok 250000 token(s): yes count is 125415, no count is 124585

Test #179:

score: 15
Accepted
time: 222ms
memory: 8640kb

input:

24242 250000
652573234313 3626051 40645325012 28868520
96257761526 62180513109 3276 62209895819
235152466577 5216436 23231540551 13958328
857562909185 815140460410 214970798459 947278642337
636421056375 40750565 936284535946 28380980
835539002053 412447863183 84848236342 412478829719
339027545702 24...

output:

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

result:

ok 250000 token(s): yes count is 125408, no count is 124592

Test #180:

score: 15
Accepted
time: 204ms
memory: 8232kb

input:

29999 250000
535384899315 526606311555 177164854308 526618252622
310619092264 841720532987 645693046181 841709363483
323730758615 893596315183 172091273428 893601370002
976536044381 328331312297 2 816599334487
773433618020 6419823 192588300175 25781980
665065710403 3201608 96045068388 22169596
76741...

output:

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

result:

ok 250000 token(s): yes count is 125327, no count is 124673

Test #181:

score: 15
Accepted
time: 152ms
memory: 6384kb

input:

13370 250000
3283657298 306077076916 671209764749 306027119840
633924819009 854349644628 480012922060 854361156363
450850906446 983980656360 430815907969 983982154864
11308 43601283 308133451265 16350658
74328282209 8240942 82708333169 7614162
310239859860 51375860 686895249792 23204178
29680517580 ...

output:

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

result:

ok 250000 token(s): yes count is 124989, no count is 125011

Test #182:

score: 15
Accepted
time: 479ms
memory: 11988kb

input:

29999 250000
423067707950 1411 684579822740 9
564132691039 1 912659356045 2607
510140961445 1 825217987268 4274
484870114650 2 783750726876 16186
385071340185 609 623076688825 2
448345521574 1 724701154717 15187
577920728177 2 934801098060 6064
489568564186 1 791618992381 10705
389080559743 2716 629...

output:

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

result:

ok 250000 token(s): yes count is 84737, no count is 165263

Test #183:

score: 15
Accepted
time: 2101ms
memory: 32880kb

input:

30000 250000
406108956101 525 657113455779 8
547747992940 1 886268832219 125
459363656554 50 743265519319 41
422756083004 70 684027801983 165
29998 522152071292 53516963 522152069509
482768440178 2 781109204425 548
425389535603 24 688285107827 213
29997 904845294020 34827171 904845292860
50827625999...

output:

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

result:

ok 250000 token(s): yes count is 127820, no count is 122180

Test #184:

score: 15
Accepted
time: 3362ms
memory: 53800kb

input:

24242 250000
579757854163 1142 938094107118 38
516210085515 1 835245409492 2
582848492225 2833 943135936220 36
36527 862428342621 33528 862428342622
584498902231 1 945739035990 2
583573027469 5904 944382000014 54
585367719192 1898 947190602315 7
617752168893 18 999543736210 18
258 789587335980 24330...

output:

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

result:

ok 250000 token(s): yes count is 64619, no count is 185381

Test #185:

score: 15
Accepted
time: 2592ms
memory: 44148kb

input:

19999 250000
529154301369 3 856189575469 4
483034364638 17383 781913403463 8
478674563145 269 774516768859 10
470226642329 8 760842817337 1
506689378626 76 819841929766 7
450338902398 20373504573 741727272967 20358934426
485338872868 19 785294654598 16
434362527464 1 702813320516 1
482841007852 1335...

output:

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

result:

ok 250000 token(s): yes count is 71971, no count is 178029

Test #186:

score: 15
Accepted
time: 1508ms
memory: 35752kb

input:

30000 250000
59998 14999 449999999 1
59998 14998 449969999 1
59998 14997 449939999 1
59998 14996 449909999 1
59998 14995 449879999 1
59998 14994 449849999 1
59998 14993 449819999 1
59998 14992 449789999 1
59998 14991 449759999 1
59998 14990 449729999 1
59998 14989 449699999 1
59998 14988 449669999 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 250000 token(s): yes count is 32941, no count is 217059

Test #187:

score: 15
Accepted
time: 1947ms
memory: 37524kb

input:

29989 250000
12 209486506510 612101466715 158478050952
29983 604617289647 2729972 604617289557
447146782415 9 723485229737 283
222697343346 739554106333 745701795716 739536666457
447032653809 8 723304175026 208
446858909066 16 723024066410 192
542248352674 127860433388 227040541266 127870944169
6534...

output:

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

result:

ok 250000 token(s): yes count is 148272, no count is 101728

Test #188:

score: 15
Accepted
time: 41ms
memory: 3756kb

input:

7 250000
14 72 33 41
43 64 63 62
34 14 69 9
19 75 21 57
47 6 43 53
19 53 58 46
50 49 49 74
30 75 53 68
36 42 53 14
70 40 52 73
70 44 75 44
38 75 72 46
11 45 20 10
25 67 35 60
54 27 14 28
53 35 26 44
10 20 60 13
61 2 41 6
54 3 66 8
43 34 69 31
52 16 3 41
53 62 33 66
15 75 27 32
73 22 22 44
66 15 56 1...

output:

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

result:

ok 250000 token(s): yes count is 123236, no count is 126764

Test #189:

score: 15
Accepted
time: 1875ms
memory: 37616kb

input:

30000 250000
438543891234 467584989293 523892534393 518192766229
59997 8712 261389998 1
3 781141510798 607411425226 578671035724
928984664018 361656350495 13 433116709265
595033200000 361334641483 49896839999 361352812696
119974 1130 33929998 3
848728589999 24544905032 260836654937 24564501430
93714...

output:

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

result:

ok 250000 token(s): yes count is 101200, no count is 148800

Test #190:

score: 15
Accepted
time: 49ms
memory: 3792kb

input:

42 250000
9 44 75 43
56 10 46 11
25 22 40 22
54 4 49 5
4 22 34 16
69 59 72 59
66 75 74 31
5 10 57 10
11 48 36 46
7 40 56 14
32 68 5 74
66 25 59 40
10 6 20 7
48 25 73 24
54 41 51 56
71 32 47 55
17 3 26 10
20 49 8 51
44 17 43 35
75 18 69 33
72 8 74 43
45 75 66 19
56 73 68 15
47 56 57 57
39 69 20 70
7 ...

output:

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

result:

ok 250000 token(s): yes count is 118956, no count is 131044

Test #191:

score: 15
Accepted
time: 49ms
memory: 3748kb

input:

74 250000
29 38 74 53
17 75 67 32
10 17 14 74
7 35 60 74
18 61 33 14
11 75 47 46
5 66 54 57
11 19 38 35
45 1 66 51
3 57 71 35
48 75 59 48
75 75 75 65
51 54 15 57
6 11 25 65
10 6 36 4
43 29 34 36
32 75 19 59
11 11 41 39
19 55 36 74
44 1 69 2
11 49 39 30
62 75 49 14
47 5 53 71
7 60 38 34
48 75 11 43
7...

output:

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

result:

ok 250000 token(s): yes count is 107243, no count is 142757

Extra Test:

score: 0
Extra Test Passed