QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#310084#8140. Customs Controls 2bachbeo2007AC ✓117ms32848kbC++233.2kb2024-01-21 01:23:022024-01-21 01:23:04

Judging History

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

  • [2024-01-21 01:23:04]
  • 评测
  • 测评结果:AC
  • 用时:117ms
  • 内存:32848kb
  • [2024-01-21 01:23:02]
  • 提交

answer

// Judges with GCC >= 12 only needs Ofast
// #pragma GCC optimize("O3,no-stack-protector,fast-math,unroll-loops,tree-vectorize")
// MLE optimization
// #pragma GCC optimize("conserve-stack")
// Old judges
// #pragma GCC target("sse4.2,popcnt,lzcnt,abm,mmx,fma,bmi,bmi2")
// New judges. Test with assert(__builtin_cpu_supports("avx2"));
// #pragma GCC target("avx2,popcnt,lzcnt,abm,bmi,bmi2,fma,tune=native")
// Atcoder
// #pragma GCC target("avx2,popcnt,lzcnt,abm,bmi,bmi2,fma")
/*
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;
- insert(x),erase(x)
- find_by_order(k): return iterator to the k-th smallest element
- order_of_key(x): the number of elements that are strictly smaller
*/
#include<bits/stdc++.h>
using namespace std;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
uniform_real_distribution<> pp(0.0,1.0);
#define int long long
#define ld long double
#define pii pair<int,int>
#define piii pair<pii,int>
#define mpp make_pair
#define fi first
#define se second
const int inf=1e18;
const int mod=998244353;
const int maxn=200005;
const int bl=650;
const int maxs=655;
const int maxm=200005;
const int maxq=1000005;
const int maxl=25;
const int maxa=1000000;
const int root=3;
int power(int a,int n){
    int res=1;
    while(n){
        if(n&1) res=res*a%mod;
        a=a*a%mod;n>>=1;
    }
    return res;
}
const int iroot=power(3,mod-2);
const int base=101;

int par[maxn],n,m;

int findpar(int u){
    if(u!=par[u]) return par[u]=findpar(par[u]);
    return u;
}
void unions(int u,int v){
    u=findpar(u);v=findpar(v);
    if(u==v) return;
    par[v]=u;
}
vector<int> edge[maxn],adj[maxn];
vector<int> order;
int num[maxn],res[maxn];

void dfs(int u){
    num[u]=1;
    for(int v:adj[u]) if(!num[v]) dfs(v);
    order.push_back(u);
}

void solve(){
    cin >> n >> m;
    order.clear();
    for(int i=1;i<=n;i++){
        par[i]=i;num[i]=0;
        edge[i].clear();
        adj[i].clear();
    }
    for(int i=1;i<=m;i++){
        int u,v;cin >> u >> v;
        edge[v].push_back(u);
    }
    for(int i=1;i<=n;i++){
        int pre=-1;
        for(int v:edge[i]){
            if(pre!=-1) unions(pre,v);
            pre=v;
        }
    }
    for(int i=1;i<=n;i++){
        for(int v:edge[i]){
            if(findpar(i)==findpar(v)){
                cout << "No\n";
                return;
            }
            else adj[findpar(v)].push_back(findpar(i));
        }
    }
    dfs(findpar(1));
    reverse(order.begin(),order.end());
    for(int i=0;i<(int)order.size();i++) num[order[i]]=i+1;
    bool check=true;
    for(int i=1;i<=n;i++){
        res[i]=num[findpar(i)];
        if(!edge[i].empty()) res[i]-=num[findpar(edge[i][0])];
        if(res[i]<=0) check=false;
    }
    if(!check){
        cout << "No\n";
        return;
    }
    cout << "Yes\n";
    for(int i=1;i<=n;i++) cout << res[i] << ' ';
    cout << '\n';
}

signed main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);cout.tie(NULL);
    int test=1;cin >> test;
    while(test--) solve();
}

这程序好像有点Bug,我给组数据试试?

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 3680kb

input:

2
3 3
1 2
1 3
2 3
8 9
1 2
1 3
1 4
2 5
3 6
4 7
5 8
6 8
7 8

output:

No
Yes
1 3 2 1 1 2 3 1 

result:

ok ok (2 test cases)

Test #2:

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

input:

2
11 16
1 2
1 3
1 4
1 5
2 6
4 6
3 7
4 7
5 8
6 8
2 9
3 9
7 10
8 10
9 11
10 11
8 10
1 2
1 3
2 4
3 5
3 6
4 6
2 7
5 7
6 8
7 8

output:

Yes
1 1 1 1 2 1 2 1 3 1 1 
No

result:

ok ok (2 test cases)

Test #3:

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

input:

1
8 10
1 2
1 3
2 4
3 5
3 6
4 6
2 7
5 7
6 8
7 8

output:

No

result:

ok ok (1 test case)

Test #4:

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

input:

1
11 16
1 2
1 3
1 4
1 5
2 6
4 6
3 7
4 7
5 8
6 8
2 9
3 9
7 10
8 10
9 11
10 11

output:

Yes
1 1 1 1 2 1 2 1 3 1 1 

result:

ok ok (1 test case)

Test #5:

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

input:

1
3 3
1 2
1 3
2 3

output:

No

result:

ok ok (1 test case)

Test #6:

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

input:

1
15 24
1 3
1 7
1 6
1 12
3 11
3 5
3 13
3 14
3 8
7 11
7 13
7 14
11 2
11 10
6 9
5 9
13 9
14 4
8 4
2 4
10 4
9 4
12 15
4 15

output:

Yes
1 2 1 1 2 3 1 3 1 2 1 5 2 3 1 

result:

ok ok (1 test case)

Test #7:

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

input:

10
20 40
1 8
1 11
1 19
8 7
8 16
8 15
8 14
8 4
8 17
11 5
11 6
11 2
11 3
7 6
7 2
7 3
16 9
16 12
15 9
15 12
14 9
4 18
4 10
5 13
5 10
6 18
6 10
2 13
2 18
3 18
3 10
9 13
9 10
12 13
12 10
19 20
17 20
13 20
18 20
10 20
20 30
8 19
19 12
5 12
5 10
10 4
18 4
18 14
14 6
15 6
15 7
7 3
17 3
17 2
2 16
9 16
9 11
1...

output:

Yes
1 1 1 3 1 1 2 1 2 1 3 2 1 1 1 1 4 1 5 1 
No
Yes
1 2 1 5 5 2 3 1 2 3 3 4 5 2 2 2 2 1 1 1 
Yes
1 3 5 5 4 2 3 6 3 1 1 1 3 1 1 1 3 1 2 1 
Yes
1 4 1 1 1 1 3 2 1 2 4 1 1 2 3 4 2 1 2 1 
Yes
1 1 1 2 3 1 1 2 2 3 1 1 4 5 1 4 2 2 2 1 
Yes
1 2 2 1 5 5 1 1 2 1 3 1 2 3 1 2 6 1 4 1 
No
Yes
1 1 3 1 3 2 2 1 1 1 ...

result:

ok ok (10 test cases)

Test #8:

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

input:

10
1919 3195
1888 1186
1186 519
1514 519
1514 859
859 1634
977 1634
977 185
185 1250
1103 1250
1103 463
463 1683
426 1683
426 1728
1728 1402
1612 1402
1612 1789
1789 857
586 857
586 1669
1669 1376
1833 1376
1833 1076
1076 749
733 749
733 551
551 217
1717 217
1717 862
862 319
96 319
96 479
479 1381
1...

output:

No
Yes
1 44 3 26 31 8 41 26 44 39 57 16 47 7 24 14 2 52 28 27 66 22 22 12 2 5 3 38 18 31 2 10 56 1 15 57 45 39 41 45 1 53 13 37 46 20 38 8 21 28 13 7 76 14 6 63 1 30 28 19 15 22 37 26 7 69 28 4 34 31 29 7 39 14 69 66 68 72 23 46 27 61 8 51 30 12 48 46 66 12 23 28 37 6 13 22 21 12 17 2 10 24 66 21 26...

result:

ok ok (10 test cases)

Test #9:

score: 0
Accepted
time: 104ms
memory: 30176kb

input:

1
181547 488264
1 172537
1 90998
1 88110
1 96832
1 114889
1 33910
1 88129
1 70671
1 63339
1 48928
1 87572
1 34438
1 159256
1 173984
1 91374
1 89583
1 47960
1 93777
1 44079
1 132241
1 85083
1 99617
1 160839
1 157126
1 178514
1 70706
1 13530
1 168869
1 29354
1 11630
1 123518
1 86921
1 19627
1 126118
1...

output:

Yes
1 1159 1559 314 642 154 1723 499 1020 716 164 274 769 854 740 1270 978 1439 793 561 637 138 208 330 894 441 579 425 381 588 282 180 301 449 1440 1738 1640 1012 1466 127 1718 1404 237 466 1598 2063 611 2093 583 715 331 394 1427 348 610 958 138 23 585 1303 679 1008 2030 73 512 1859 599 1680 637 77...

result:

ok ok (1 test case)

Test #10:

score: 0
Accepted
time: 89ms
memory: 30628kb

input:

1
180842 301400
100472 98062
98062 152871
139599 152871
139599 97417
97417 138150
99214 138150
99214 110823
110823 179307
54096 179307
54096 169504
169504 60019
92807 60019
92807 176799
176799 10766
51615 10766
51615 85235
85235 110883
72664 110883
72664 81826
81826 151507
21410 151507
21410 148464
...

output:

No

result:

ok ok (1 test case)

Test #11:

score: 0
Accepted
time: 108ms
memory: 32156kb

input:

1
195719 496023
1 37447
1 94499
1 93445
1 159134
1 9294
1 28312
1 159443
1 12198
1 175523
1 167569
1 182624
1 61106
1 109758
1 83799
1 70857
1 180981
1 90329
1 63481
1 5198
1 54301
1 29404
1 77383
1 193083
1 48588
1 143999
1 189809
1 102318
1 39109
1 50191
1 18419
1 162337
1 16535
1 8472
1 168713
1 ...

output:

Yes
1 784 392 54 313 428 29 388 459 455 135 446 50 534 583 10 356 319 450 897 287 385 768 137 683 653 43 445 134 537 470 414 415 465 550 161 657 177 115 133 138 195 10 781 709 672 490 154 102 128 213 18 468 504 15 397 492 401 441 580 317 602 102 793 340 76 309 728 143 107 474 481 39 521 637 561 239 ...

result:

ok ok (1 test case)

Test #12:

score: 0
Accepted
time: 92ms
memory: 32848kb

input:

1
195881 326465
4835 48280
48280 145430
69556 145430
69556 139594
139594 100169
113695 100169
113695 9721
9721 159758
45959 159758
45959 138631
138631 105525
161337 105525
161337 145825
145825 13840
115797 13840
115797 192352
192352 59986
147016 59986
147016 106035
106035 42785
87638 42785
87638 102...

output:

No

result:

ok ok (1 test case)

Test #13:

score: 0
Accepted
time: 117ms
memory: 31128kb

input:

1
200000 498030
1 61309
1 80811
1 159457
1 53775
1 53080
1 73194
1 50600
1 182243
1 70727
1 55494
1 86417
1 159878
1 131249
1 24024
1 131422
1 152466
1 61113
1 30222
1 199135
1 117959
1 27855
1 195292
1 181094
1 16962
1 123395
1 114071
1 116743
1 198435
1 182160
1 170066
1 142336
1 158861
1 83699
1 ...

output:

Yes
1 190 123 107 51 26 70 405 59 308 118 115 67 279 386 264 467 110 202 415 156 162 131 270 114 367 115 49 62 68 152 197 185 115 34 74 118 26 84 353 294 296 228 487 80 211 3 77 226 120 166 479 149 335 180 324 10 144 234 43 287 208 81 88 247 224 69 150 392 351 215 68 30 127 391 167 21 179 393 115 25...

result:

ok ok (1 test case)

Test #14:

score: 0
Accepted
time: 114ms
memory: 31176kb

input:

1
200000 496308
1 67125
1 87884
1 23447
1 175546
1 183274
1 9684
1 115668
1 110230
1 115021
1 162717
1 101513
1 182387
1 118073
1 43089
1 37679
1 125719
1 149180
1 181735
1 118142
1 29
1 92393
1 16214
1 75575
1 51852
1 85094
1 131713
1 122543
1 28961
1 10685
1 128461
1 57196
1 141573
1 80411
1 39767...

output:

Yes
1 479 363 143 633 495 248 660 738 471 759 803 183 798 323 60 403 587 422 206 140 144 357 684 149 1 205 488 55 589 260 332 244 426 693 537 206 245 147 69 539 11 417 206 327 159 773 130 250 3 114 448 587 780 273 11 268 474 119 25 614 37 624 7 502 615 872 133 80 256 83 19 177 622 88 121 338 78 413 ...

result:

ok ok (1 test case)

Test #15:

score: 0
Accepted
time: 115ms
memory: 32816kb

input:

1
200000 494647
1 40292
1 144979
1 143414
1 20633
1 103476
1 41901
1 54942
1 7709
1 13011
1 183194
1 10687
1 173540
1 46370
1 199713
1 197513
1 164369
1 56771
1 188738
1 191416
1 134766
1 174253
1 189997
1 62461
1 77816
1 155675
1 53293
1 73007
1 123351
1 73328
1 134584
1 192547
1 94713
1 87884
1 16...

output:

Yes
1 851 615 135 177 64 347 599 550 364 82 434 815 676 513 523 481 510 441 348 19 224 435 220 724 238 606 245 412 497 950 518 362 343 268 172 150 405 823 902 326 387 475 277 668 94 559 1225 112 970 526 429 505 571 978 642 251 262 290 24 686 137 1246 657 1078 1123 56 241 188 466 278 997 11 267 981 2...

result:

ok ok (1 test case)

Test #16:

score: 0
Accepted
time: 115ms
memory: 31108kb

input:

1
196815 497583
1 155797
1 193300
1 125537
1 194998
1 189169
1 149571
1 81372
1 129406
1 85598
1 187825
1 36566
1 180012
1 10823
1 62405
1 46314
1 4001
1 61376
1 137856
1 42774
1 129337
1 35178
1 102964
1 174069
1 101483
1 121457
1 153968
1 77937
1 99096
1 155052
1 58925
1 36248
1 14075
1 57233
1 76...

output:

Yes
1 115 153 139 16 32 15 79 274 479 384 6 38 109 86 15 129 152 8 207 148 319 232 408 150 426 3 112 23 98 495 371 90 107 348 183 281 177 237 300 79 284 277 151 226 173 516 190 323 298 139 378 39 482 3 281 343 342 20 287 10 224 565 137 53 288 83 61 55 180 12 99 19 416 92 478 146 123 43 322 90 335 14...

result:

ok ok (1 test case)

Test #17:

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

input:

4
50000 99992
1 37052
1 42568
1 64
1 29389
1 33625
1 45029
1 29776
1 14888
1 15856
1 34822
1 42758
1 45081
1 41042
1 18758
1 22373
1 2232
1 48245
1 8335
1 30504
1 24566
1 43294
1 48483
1 17157
1 45811
1 13014
1 11847
1 19635
1 22669
1 46134
1 12982
1 30977
1 26649
1 17344
1 41235
1 6192
1 12638
1 25...

output:

Yes
1 143 36 18 33 66 23 173 56 208 16 93 6 43 19 202 33 46 124 47 54 63 100 28 76 65 62 98 152 148 77 78 134 93 84 146 75 181 55 93 118 56 15 183 75 93 245 20 151 61 138 133 144 7 68 40 98 127 79 112 141 156 169 1 131 122 160 220 196 99 38 197 138 35 159 258 63 57 75 48 34 26 114 159 208 192 56 74 ...

result:

ok ok (4 test cases)

Test #18:

score: 0
Accepted
time: 76ms
memory: 16044kb

input:

4
50000 99987
1 26348
1 28062
1 21534
1 42614
1 37721
1 47094
1 26341
1 48507
1 30205
1 18544
1 22338
1 11500
1 36134
1 49034
1 3366
1 333
1 21428
1 34175
1 25082
1 14845
1 46041
1 41371
1 45461
1 43435
1 16198
1 27448
1 20195
1 41680
1 30051
1 27745
1 44032
1 26376
1 31540
1 39763
1 22578
1 33250
1...

output:

Yes
1 89 19 80 132 122 133 79 277 246 9 102 264 18 35 152 96 64 69 86 114 7 19 4 75 235 97 110 200 81 134 4 59 177 205 164 26 127 149 208 78 297 60 122 160 33 48 7 129 68 91 32 160 18 86 99 29 30 180 227 104 121 28 53 125 96 46 197 76 101 1 28 76 1 98 70 123 63 142 24 154 230 87 215 85 134 300 106 1...

result:

ok ok (4 test cases)

Test #19:

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

input:

4
46544 77570
5146 33799
33799 24403
20994 24403
20994 6976
6976 17268
23793 17268
23793 34344
34344 3356
43440 3356
43440 44237
44237 10294
28698 10294
28698 39637
39637 18139
35928 18139
35928 44391
44391 33265
1826 33265
1826 6813
6813 10489
14783 10489
14783 39250
39250 3550
43164 3550
43164 516...

output:

No
Yes
1 116 104 202 20 77 143 199 247 241 74 260 174 2 124 174 127 80 109 23 86 93 25 167 169 94 95 169 104 93 212 151 114 87 137 117 87 159 30 8 277 45 92 45 118 44 32 240 38 122 66 152 122 60 44 125 165 103 126 101 37 50 310 124 106 194 118 60 19 134 285 28 91 244 186 138 115 124 121 92 138 97 17...

result:

ok ok (4 test cases)

Test #20:

score: 0
Accepted
time: 60ms
memory: 18420kb

input:

4
50000 99982
1 44586
1 26416
1 13734
1 14946
1 15582
1 48832
1 48946
1 49537
1 2997
1 44139
1 38283
1 42638
1 45750
1 30506
1 42989
1 4251
1 47124
1 11832
1 46680
1 17060
1 31444
1 17322
1 44148
1 45927
1 19806
1 45126
1 10678
1 34979
1 33116
1 19659
1 19963
1 47207
1 38543
1 23992
1 47547
1 30810
...

output:

Yes
1 148 46 71 194 41 76 247 88 263 196 285 320 116 274 6 19 56 9 4 101 350 46 44 112 67 65 135 129 168 28 178 174 211 58 25 270 85 213 307 204 104 92 334 323 107 261 56 76 63 235 118 182 236 161 154 117 208 123 189 51 123 119 97 273 60 41 170 125 88 9 4 34 92 94 71 177 82 318 153 5 279 15 263 220 ...

result:

ok ok (4 test cases)

Test #21:

score: 0
Accepted
time: 66ms
memory: 18608kb

input:

4
48440 80730
20510 37086
37086 41968
37277 41968
37277 32029
32029 12807
4350 12807
4350 5096
5096 13315
233 13315
233 26078
26078 39649
34279 39649
34279 30398
30398 19295
35076 19295
35076 10210
10210 23140
40175 23140
40175 24651
24651 10464
6146 10464
6146 20178
20178 6945
32095 6945
32095 398
...

output:

No
Yes
1 114 130 185 42 38 24 34 129 7 34 82 74 181 54 2 70 105 118 2 84 41 90 45 57 31 111 79 172 109 162 39 9 85 49 63 152 27 137 135 46 178 184 100 20 32 167 112 133 113 69 1 27 11 40 109 69 208 79 7 7 138 156 195 112 15 142 130 147 113 53 16 84 84 39 38 105 83 147 17 34 84 82 56 75 37 101 31 31 ...

result:

ok ok (4 test cases)

Test #22:

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

input:

4
50000 99978
1 28364
1 35612
1 47359
1 13620
1 30756
1 11913
1 7196
1 38786
1 30188
1 48614
1 13513
1 49242
1 2768
1 8699
1 24695
1 44809
1 28800
1 42856
1 416
1 44350
1 35045
1 26340
1 6524
1 39330
1 19440
1 31508
1 37508
1 25780
1 3393
1 41409
1 28384
1 11978
1 6137
1 3202
1 15895
1 44535
1 2860
...

output:

Yes
1 42 187 142 380 302 196 182 229 325 231 82 53 61 256 131 348 300 3 20 191 389 46 312 175 279 3 152 107 232 445 481 339 233 265 162 31 64 78 2 96 395 98 158 269 257 260 252 10 150 204 154 199 222 30 22 19 239 226 338 41 387 51 255 224 425 36 366 437 293 102 243 316 3 110 160 2 193 434 31 86 149 ...

result:

ok ok (4 test cases)

Test #23:

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

input:

4
45901 99522
1 18883
1 16169
1 24663
1 35800
1 39712
1 43438
1 44701
1 30656
1 38898
1 40326
1 43301
1 25369
1 42501
1 35809
1 10640
1 9339
1 38562
1 42600
1 158
1 21847
1 19980
1 20090
1 32169
1 8928
1 16065
1 6917
1 35776
1 45788
1 32598
1 17405
1 798
1 25226
1 8067
1 24647
1 5083
1 14754
1 4293
...

output:

Yes
1 116 227 40 282 74 249 32 29 17 413 265 203 255 160 153 43 144 186 241 50 323 100 36 34 84 347 112 340 160 78 25 317 207 120 67 27 114 59 41 40 21 146 268 117 135 15 194 208 193 62 77 205 1 90 288 267 113 174 246 241 160 77 78 219 8 67 33 41 123 31 252 188 290 36 40 22 165 196 98 38 10 138 200 ...

result:

ok ok (4 test cases)

Test #24:

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

input:

4
50000 99561
1 9493
1 4375
1 19778
1 17185
1 47877
1 20599
1 9768
1 37858
1 15658
1 13556
1 5845
1 38836
1 14046
1 30325
1 19245
1 11055
1 45732
1 40427
1 18069
1 2936
1 5434
1 14846
1 15104
1 762
1 16135
1 28604
1 45416
1 865
1 33562
1 4793
1 17457
1 43485
1 15706
1 37883
1 21892
1 39920
1 8477
1 ...

output:

Yes
1 566 1515 505 32 1392 873 285 29 1344 79 319 1501 281 377 263 634 408 277 2081 710 312 956 1153 607 679 436 1290 153 1585 198 89 110 1746 45 245 1522 1255 106 67 1147 1958 569 1481 430 689 544 170 1270 1227 384 2123 552 81 337 819 1 204 181 1933 1155 1051 738 704 272 1394 452 744 1158 715 1593 ...

result:

ok ok (4 test cases)

Test #25:

score: 0
Accepted
time: 61ms
memory: 15388kb

input:

10
20000 49560
1 12421
1 18824
1 7063
1 6144
1 18228
1 10289
1 18844
1 16226
1 16484
1 15230
1 1325
1 9893
1 8118
1 6648
1 18994
1 14612
1 18502
1 3075
1 9636
1 914
1 2702
1 8055
1 15865
1 5437
1 13614
1 5111
1 3875
1 19395
1 19759
1 4084
1 6443
1 14246
1 6291
1 17649
1 12872
1 9223
1 9642
1 16067
1...

output:

Yes
1 62 37 40 38 58 46 2 35 92 31 28 43 30 31 8 58 47 5 69 41 58 51 86 33 127 36 84 81 58 68 77 55 127 63 10 32 89 9 7 91 12 16 44 81 15 54 92 28 142 6 36 138 15 25 14 55 9 80 77 8 15 23 84 117 69 101 18 3 32 41 38 24 78 117 113 99 107 58 1 126 66 35 115 26 38 1 55 65 137 107 87 14 47 38 98 99 9 11...

result:

ok ok (10 test cases)

Test #26:

score: 0
Accepted
time: 63ms
memory: 15304kb

input:

10
20000 49107
1 2585
1 5845
1 8900
1 17326
1 5237
1 7619
1 6910
1 5560
1 7767
1 13249
1 16441
1 4223
1 8764
1 7632
1 14152
1 5888
1 17688
1 6705
1 18011
1 5206
1 2533
1 4756
1 9396
1 14175
1 10340
1 13664
1 2459
1 15061
1 4081
1 7025
1 4435
1 9
1 19720
1 7035
1 7721
1 9669
1 8989
1 11217
1 9496
1 8...

output:

Yes
1 100 203 206 18 196 53 146 69 162 117 113 213 66 12 36 192 205 172 109 128 219 190 207 10 30 143 43 189 194 77 7 48 99 61 206 53 70 151 72 9 138 93 118 55 11 19 140 130 38 70 8 122 250 83 139 2 93 62 35 63 28 65 101 151 91 50 225 132 4 243 271 93 252 220 122 26 1 23 75 148 174 55 55 131 115 39 ...

result:

ok ok (10 test cases)

Test #27:

score: 0
Accepted
time: 73ms
memory: 14340kb

input:

10
20000 49355
1 7470
1 7577
1 9444
1 15558
1 7425
1 3863
1 17023
1 11796
1 6149
1 11714
1 6227
1 3974
1 2051
1 12472
1 162
1 846
1 13731
1 18883
1 3493
1 6308
1 2308
1 12711
1 711
1 3217
1 3536
1 6648
1 3836
1 15134
1 18111
1 8632
1 7968
1 2318
1 584
1 10247
1 11066
1 15015
1 3315
1 15121
1 9663
1 ...

output:

Yes
1 108 153 10 67 66 2 57 149 126 5 54 119 51 137 25 87 81 1 41 94 92 29 111 53 22 36 72 124 140 125 61 87 151 23 129 34 32 3 49 58 138 129 81 132 16 41 30 54 87 131 55 28 67 125 49 22 163 140 33 51 166 42 87 42 37 17 142 8 80 106 40 31 31 39 71 170 20 58 34 41 21 83 110 18 100 137 60 139 74 63 10...

result:

ok ok (10 test cases)

Test #28:

score: 0
Accepted
time: 73ms
memory: 15344kb

input:

10
20000 49306
1 7640
1 19539
1 10600
1 7349
1 8170
1 17293
1 3327
1 1538
1 10166
1 961
1 4723
1 10857
1 15980
1 4810
1 11977
1 16853
1 14175
1 3467
1 17354
1 15184
1 19601
1 12222
1 4953
1 3699
1 2097
1 4341
1 11166
1 16802
1 10024
1 6743
1 14735
1 3824
1 9205
1 727
1 2759
1 2973
1 15939
1 1566
1 1...

output:

Yes
1 79 5 148 34 79 10 20 112 77 123 33 41 86 81 117 8 37 162 57 118 58 91 72 163 80 32 33 95 57 36 25 23 112 123 15 110 63 71 91 113 83 39 38 49 62 72 77 104 133 8 76 19 117 32 110 62 8 130 77 67 50 19 136 102 132 60 106 34 35 100 61 114 82 113 50 82 61 132 8 66 194 64 30 42 50 30 131 50 137 132 2...

result:

ok ok (10 test cases)

Test #29:

score: 0
Accepted
time: 67ms
memory: 15728kb

input:

10
20000 49519
1 8235
1 7650
1 3118
1 17111
1 15781
1 16102
1 19721
1 17353
1 2190
1 10928
1 10843
1 18647
1 17340
1 9304
1 8101
1 7939
1 16815
1 1635
1 14666
1 8181
1 11412
1 109
1 16165
1 3710
1 10306
1 17420
1 6735
1 2471
1 2099
1 2308
1 4171
1 6075
1 3641
1 10159
1 7087
1 2055
1 5638
1 12576
1 2...

output:

Yes
1 3 9 30 88 20 91 38 26 2 11 8 63 56 31 36 88 23 62 1 81 108 64 113 2 103 23 61 8 47 22 90 46 111 49 93 24 65 91 43 122 72 32 97 70 6 19 105 46 39 1 46 101 13 25 34 43 4 15 34 74 29 29 16 14 10 65 51 1 10 29 19 11 44 80 23 64 94 50 35 25 3 93 31 27 33 5 66 25 70 63 12 8 124 83 80 61 40 37 36 6 3...

result:

ok ok (10 test cases)

Test #30:

score: 0
Accepted
time: 66ms
memory: 13448kb

input:

10
19817 33025
8702 12298
12298 8087
14391 8087
14391 15275
15275 13489
7589 13489
7589 13828
13828 17626
13759 17626
13759 15568
15568 7861
7560 7861
7560 1415
1415 3704
16988 3704
16988 7209
7209 11660
3746 11660
3746 537
537 18694
9263 18694
9263 7359
7359 15346
11798 15346
11798 794
794 10169
18...

output:

No
No
Yes
1 97 94 4 37 2 57 35 53 68 94 1 15 74 114 96 26 75 84 47 71 57 49 21 57 45 38 114 79 7 90 20 29 16 54 94 88 21 39 81 5 101 126 65 38 33 149 20 101 77 1 30 79 46 83 2 12 118 60 18 110 101 25 117 38 60 7 72 30 122 62 69 109 91 6 42 35 71 53 94 140 139 4 159 61 74 24 93 138 56 76 10 18 63 56 ...

result:

ok ok (10 test cases)

Test #31:

score: 0
Accepted
time: 63ms
memory: 16044kb

input:

10
20000 46778
1 17666
1 9583
1 11152
1 10784
1 1976
1 530
1 16681
1 15370
1 5019
1 18392
1 1399
1 488
1 454
1 16246
1 13133
1 3027
1 18304
1 15782
1 768
1 14823
1 13200
1 7920
1 346
1 6059
1 13204
1 9737
1 7592
1 19616
1 2964
1 9331
1 14593
1 7052
1 602
1 12049
1 15523
1 9925
1 3494
1 15517
1 18307...

output:

Yes
1 287 432 283 100 304 318 1052 516 243 727 417 210 526 6 281 834 523 388 278 494 184 134 396 71 174 1095 76 7 1140 63 58 254 552 1175 728 377 867 26 77 649 83 784 997 252 983 966 612 972 620 564 543 314 395 58 168 3 388 571 837 963 708 241 305 75 88 389 233 299 219 218 155 791 525 22 377 2 755 2...

result:

ok ok (10 test cases)

Test #32:

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

input:

10
18919 48489
1 5647
1 13440
1 9257
1 2479
1 7324
1 18716
1 5839
1 7538
1 2868
1 18485
1 3031
1 14830
1 3522
1 11211
1 10343
1 15329
1 4888
1 17703
1 342
1 18032
1 14491
1 8520
1 13101
1 4569
1 6716
1 16225
1 4159
1 5545
1 13225
1 11735
1 16867
1 7687
1 3712
1 3458
1 9859
1 11566
1 14696
1 7612
1 6...

output:

Yes
1 49 116 44 99 53 273 181 150 100 32 197 326 77 62 202 226 206 154 9 334 81 225 24 31 20 282 378 164 226 159 136 208 22 250 307 213 215 47 8 26 47 151 249 303 60 162 20 237 16 107 315 120 110 10 324 215 46 203 46 115 319 39 42 365 22 117 153 135 116 222 291 278 72 5 54 60 60 262 2 186 38 61 159 ...

result:

ok ok (10 test cases)

Test #33:

score: 0
Accepted
time: 51ms
memory: 10116kb

input:

40
5000 11814
1 3958
1 4783
1 1625
1 4971
1 2666
1 4347
1 4726
1 983
1 3194
1 3690
1 2027
1 3165
1 2524
1 3054
1 2784
1 2288
1 954
1 3066
1 4592
1 3744
1 894
1 3044
1 4129
1 4206
1 4340
1 1312
1 282
1 407
1 4190
1 980
1 2100
1 1245
1 600
1 2680
1 4984
1 1058
1 2320
1 4736
1 1835
1 772
1 3850
1 3434
...

output:

Yes
1 42 1 32 47 67 53 1 81 177 27 100 140 146 137 24 70 72 236 21 42 172 82 82 8 52 88 37 108 51 34 56 89 34 97 137 6 170 93 132 182 201 3 23 8 12 151 27 108 49 57 174 71 14 156 65 115 231 162 61 157 1 42 99 141 101 32 33 30 190 118 68 140 135 3 141 96 8 64 1 12 56 138 43 71 20 34 215 31 26 147 145...

result:

ok ok (40 test cases)

Test #34:

score: 0
Accepted
time: 46ms
memory: 12060kb

input:

40
4721 7865
3857 3817
3817 3296
3963 3296
3963 4111
4111 475
257 475
257 1447
1447 4646
2028 4646
2028 3185
3185 3622
4651 3622
4651 1160
1160 1260
2044 1260
2044 2212
2212 4504
3886 4504
3886 1332
1332 2499
526 2499
526 2467
2467 924
3996 924
3996 1185
1185 4187
1816 4187
1816 307
307 3579
220 357...

output:

No
Yes
1 254 213 288 2 50 109 203 2 247 151 53 389 41 328 200 227 57 261 189 112 122 266 202 35 246 427 330 34 72 28 6 34 94 18 18 194 1 163 381 64 169 426 304 53 55 153 323 87 235 5 1 251 196 16 61 100 148 153 322 54 139 64 87 93 212 6 155 251 83 30 85 1 186 163 356 1 150 2 247 161 276 128 92 57 15...

result:

ok ok (40 test cases)

Test #35:

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

input:

40
4764 12096
1 4578
1 3298
1 4612
1 3807
1 3223
1 2526
1 2712
1 3568
1 1422
1 4727
1 4155
1 3080
1 659
1 3218
1 3075
1 3893
1 458
1 1821
1 587
1 4675
1 816
1 533
1 148
1 928
1 4335
1 3122
1 4506
1 3792
1 3766
1 2912
1 3651
1 2310
1 3119
1 2038
1 2452
1 1449
1 2758
1 1975
1 2962
1 4657
1 3038
1 2371...

output:

Yes
1 34 3 48 71 74 64 11 19 12 50 11 11 6 45 46 15 7 54 12 23 9 75 1 13 4 99 13 43 28 65 72 34 12 12 23 15 26 46 88 48 100 51 3 46 5 74 86 30 52 19 53 43 27 9 1 81 24 18 82 15 48 16 6 55 74 63 68 45 9 35 13 8 84 63 62 18 75 67 48 39 36 39 36 34 42 77 29 53 43 110 17 5 2 7 36 89 67 7 64 63 5 11 15 2...

result:

ok ok (40 test cases)

Test #36:

score: 0
Accepted
time: 61ms
memory: 10340kb

input:

40
4778 7960
2767 1868
1868 1252
1808 1252
1808 1426
1426 2084
4736 2084
4736 3578
3578 505
4167 505
4167 4537
4537 1732
2227 1732
2227 1876
1876 3989
4495 3989
4495 353
353 3061
2281 3061
2281 4502
4502 2478
83 2478
83 603
603 621
1033 621
1033 3023
3023 1777
1320 1777
1320 3704
3704 2126
1341 2126...

output:

No
Yes
1 46 96 319 214 289 237 305 442 258 179 298 134 100 447 125 32 198 320 88 91 161 200 167 72 61 116 175 395 124 140 54 381 275 120 4 9 95 330 57 274 28 335 138 175 4 213 400 41 490 391 35 51 2 18 120 364 389 107 208 241 1 1 86 126 310 492 138 311 1 547 156 90 113 125 105 129 180 170 12 600 37 ...

result:

ok ok (40 test cases)

Test #37:

score: 0
Accepted
time: 58ms
memory: 10708kb

input:

40
4837 11978
1 2353
1 1062
1 3787
1 4402
1 4050
1 1049
1 795
1 1018
1 3962
1 4447
1 2062
1 4467
1 2569
1 3967
1 3946
1 766
1 2336
1 1273
1 3153
1 4219
1 2927
1 1213
1 668
1 3004
1 1515
1 641
1 1358
1 4768
1 2183
1 2565
1 3675
1 2458
1 297
1 1055
1 3881
1 4719
1 579
1 2119
1 484
1 224
1 4315
1 2878
...

output:

Yes
1 4 107 90 12 20 56 123 79 40 36 4 51 30 57 18 97 27 74 14 22 1 40 35 57 12 14 99 64 40 102 16 110 87 137 40 18 101 13 48 80 84 114 156 146 62 35 60 10 48 27 68 100 39 35 69 9 17 6 83 38 1 69 57 81 39 54 54 52 73 43 147 141 39 14 46 54 17 14 56 9 50 17 17 29 25 138 68 41 54 104 74 25 77 85 52 16...

result:

ok ok (40 test cases)

Test #38:

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

input:

40
4531 11826
1 469
1 499
1 1329
1 1084
1 1582
1 4286
1 3566
1 4385
1 1823
1 4161
1 1884
1 623
1 321
1 198
1 3228
1 4165
1 2720
1 4092
1 2876
1 2853
1 1308
1 3671
1 4036
1 2147
1 3881
1 2180
1 3193
1 3794
1 2421
1 3051
1 1550
1 1430
1 1273
1 355
1 3728
1 320
1 1429
1 2111
1 93
1 1229
1 4516
1 3476
1...

output:

Yes
1 21 1 104 105 1 34 1 45 66 15 38 106 126 53 20 50 25 126 5 6 33 128 57 27 4 76 67 17 10 126 39 79 54 99 22 129 84 35 28 47 105 96 109 30 6 20 31 5 10 4 100 57 13 50 60 55 72 126 38 96 114 47 71 107 37 42 111 20 27 57 69 105 10 63 48 139 116 39 66 33 14 8 9 87 55 142 126 115 62 56 115 109 11 30 ...

result:

ok ok (40 test cases)

Test #39:

score: 0
Accepted
time: 61ms
memory: 12720kb

input:

40
5000 12093
1 4282
1 4844
1 4912
1 4220
1 4200
1 796
1 1478
1 3428
1 4898
1 4881
1 549
1 2913
1 4823
1 3658
1 2576
1 1732
1 3627
1 4938
1 2055
1 1088
1 769
1 2935
1 1085
1 1698
1 4172
1 1962
1 24
1 3967
1 206
1 163
1 3524
1 4740
1 3288
1 4368
1 4767
1 4508
1 4271
1 1004
1 966
1 1612
1 328
1 1015
1...

output:

Yes
1 80 75 72 65 14 41 9 18 78 74 78 35 10 17 111 18 24 37 58 70 22 12 29 19 22 38 66 52 99 71 62 17 12 73 47 1 77 19 78 48 28 38 86 8 53 73 39 18 84 39 38 50 81 20 4 40 26 78 93 4 9 32 11 47 11 6 14 7 3 13 37 74 75 53 43 59 45 7 7 11 76 40 55 67 11 5 1 50 20 29 33 14 7 93 41 28 39 44 14 42 40 60 9...

result:

ok ok (40 test cases)

Test #40:

score: 0
Accepted
time: 46ms
memory: 10376kb

input:

40
5000 12265
1 3936
1 3755
1 2242
1 136
1 3205
1 2971
1 1659
1 1707
1 150
1 554
1 4766
1 2084
1 3640
1 3266
1 2867
1 3424
1 2176
1 1288
1 3127
1 4005
1 2554
1 868
1 3477
1 912
1 2149
1 1582
1 3442
1 4186
1 522
1 3063
1 1635
1 741
1 3109
1 403
1 4529
1 1244
1 2880
1 2318
1 2161
1 3466
1 3931
1 1488
...

output:

Yes
1 29 4 21 15 26 17 25 36 13 24 1 30 28 14 48 5 46 25 22 24 31 13 18 35 54 46 48 15 3 81 36 69 4 25 35 19 3 26 10 29 21 77 14 82 59 17 5 16 35 29 4 27 40 2 63 11 25 28 9 27 7 40 32 58 7 24 1 53 69 2 7 4 26 15 26 70 32 52 46 6 9 25 7 6 12 3 24 6 25 33 12 33 65 47 5 29 15 22 11 30 24 5 4 40 42 29 6...

result:

ok ok (40 test cases)

Test #41:

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

input:

100
1870 3399
1 808
1 1347
1 1776
1 1128
1 1263
1 1100
1 1741
1 1497
1 33
1 1749
808 640
808 429
808 1099
808 1625
808 89
808 757
808 73
808 739
808 1295
808 578
808 1248
640 1242
640 747
640 908
640 934
640 243
640 1700
640 1275
640 272
640 383
1347 518
1347 1209
1347 13
1347 560
1347 440
518 45
51...

output:

Yes
1 488 4 243 219 1 100 10 1 52 4 287 64 419 100 468 164 201 95 1 372 140 23 10 409 397 382 1 405 1 232 1 620 59 357 26 3 1 338 5 5 13 2 1 16 371 286 444 178 23 137 3 17 416 138 1 262 125 294 178 69 5 10 319 1 121 1 495 14 166 14 278 356 161 18 183 377 2 142 157 200 324 62 1 138 434 14 445 245 16 ...

result:

ok ok (100 test cases)

Test #42:

score: 0
Accepted
time: 46ms
memory: 6336kb

input:

100
1944 4734
1 1018
1 1785
1 561
1 1221
1 107
1 1848
1 181
1 375
1 380
1 454
1 871
1 953
1 912
1 998
1 401
1 1709
1 581
1 417
1 1226
1 1328
1 1633
1 678
1 936
1 404
1 1909
1 125
1 190
1 900
1 712
1 732
1 1274
1 1489
1 1008
1 1600
1 1367
1 434
1 35
1 52
1 945
1 159
1 782
1 903
1 337
1 1353
1 838
1 5...

output:

Yes
1 20 44 53 15 13 58 43 16 20 63 32 62 6 22 18 50 2 41 52 19 29 19 11 34 12 1 63 48 25 35 23 7 81 64 14 24 55 7 52 5 6 63 37 31 40 6 44 17 3 42 77 8 29 9 17 29 63 43 48 83 1 26 52 50 13 59 1 5 61 5 17 21 49 38 43 9 5 13 3 52 54 58 54 9 80 16 20 40 33 48 2 1 20 34 25 38 6 47 59 25 17 50 50 21 24 8...

result:

ok ok (100 test cases)

Test #43:

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

input:

100
1941 4777
1 591
1 1042
1 162
1 27
1 1673
1 1394
1 50
1 209
1 782
1 1758
1 915
1 968
1 1660
1 1815
1 940
1 1049
1 325
1 1489
1 267
1 263
1 707
1 578
1 749
1 1218
1 660
1 1391
1 1029
1 415
1 1627
1 361
1 527
1 1899
1 362
1 805
1 324
1 1286
1 20
1 583
1 791
1 1041
1 530
1 1050
1 1356
1 1839
1 256
1...

output:

Yes
1 25 9 32 57 41 3 6 22 10 2 7 1 34 46 8 51 13 1 45 8 11 15 28 11 43 4 6 17 18 46 50 14 15 18 17 3 36 31 4 14 21 39 12 18 6 34 5 36 7 58 7 5 6 20 12 9 53 22 22 1 8 10 7 24 20 20 4 17 19 23 33 10 55 39 29 13 12 37 5 16 36 14 26 30 40 11 32 6 38 32 34 34 11 59 36 21 56 11 6 5 45 62 24 28 13 35 35 1...

result:

ok ok (100 test cases)

Test #44:

score: 0
Accepted
time: 60ms
memory: 8376kb

input:

100
1950 4510
1 1676
1 920
1 245
1 1944
1 1448
1 550
1 1032
1 776
1 376
1 618
1 1640
1 1887
1 585
1 1203
1 1187
1 139
1 1080
1 1625
1 1191
1 1136
1 1223
1 1229
1 1627
1676 29
1676 41
1676 1731
1676 1076
1676 1341
1676 1237
1676 1444
1676 117
1676 579
1676 599
1676 1822
1676 1834
1676 1035
1676 652
1...

output:

Yes
1 1 83 80 55 37 15 63 104 14 41 61 30 1 31 47 70 21 105 46 58 27 72 138 60 102 148 140 2 69 28 41 65 145 110 29 89 15 3 104 4 110 24 2 99 73 24 72 33 4 56 9 25 25 71 97 84 21 67 141 31 38 70 21 2 60 22 40 114 98 48 36 35 39 11 66 125 10 6 67 56 14 50 57 54 36 79 140 53 101 32 12 47 81 26 17 35 7...

result:

ok ok (100 test cases)

Test #45:

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

input:

100
1937 3225
1707 1249
1249 1515
1032 1515
1032 1779
1779 1399
1443 1399
1443 1649
1649 683
1934 683
1934 1051
1051 1344
69 1344
69 1304
1304 1210
1648 1210
1648 1146
1146 924
729 924
729 282
282 580
816 580
816 1440
1440 781
383 781
383 1273
1273 587
1118 587
1118 1751
1751 853
289 853
289 296
296...

output:

No
Yes
1 23 12 14 13 76 21 1 16 1 8 47 38 7 10 31 79 39 28 1 74 20 22 33 11 32 39 18 56 21 6 30 10 13 4 10 40 16 54 16 12 26 70 61 30 7 87 35 4 28 1 26 23 55 16 28 58 30 24 25 45 63 48 34 25 61 67 34 16 17 44 4 38 7 38 11 56 41 15 23 1 19 47 45 32 11 65 80 87 8 74 28 67 34 60 74 55 14 40 36 12 84 34...

result:

ok ok (100 test cases)

Test #46:

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

input:

100
1907 4098
1 1269
1 1056
1 846
1 645
1 160
1 955
1 310
1 774
1 73
1 989
1 1787
1 1802
1 1728
1 1577
1 524
1269 378
1269 1503
1269 1362
1269 1241
1269 1642
1269 928
1269 659
1269 115
1269 1372
1269 870
1269 1057
1269 1775
1056 1357
1056 726
1056 1849
1056 1850
1056 40
1056 896
1056 1471
1056 235
1...

output:

Yes
1 65 55 206 174 1 137 205 136 25 74 235 109 3 141 1 3 102 106 153 294 286 239 90 157 81 27 135 142 57 6 54 72 1 97 263 104 120 112 13 134 134 135 26 26 16 15 260 56 58 25 109 124 1 11 135 105 13 147 106 11 110 47 55 3 138 95 79 160 212 67 44 214 20 18 201 136 183 76 149 1 59 185 111 19 87 87 114...

result:

ok ok (100 test cases)

Test #47:

score: 0
Accepted
time: 42ms
memory: 10348kb

input:

100
1892 3150
1876 1550
1550 1752
1857 1752
1857 1805
1805 1628
1733 1628
1733 1352
1352 1227
155 1227
155 1885
1885 1662
348 1662
348 900
900 1774
689 1774
689 1476
1476 57
1685 57
1685 403
403 699
978 699
978 187
187 1001
19 1001
19 1719
1719 690
1164 690
1164 132
132 1769
113 1769
113 1784
1784 1...

output:

No
Yes
1 30 14 6 8 35 26 41 25 53 42 50 13 44 36 13 1 34 13 11 51 20 3 24 24 9 34 10 11 29 37 19 20 26 52 14 3 14 27 20 42 34 21 52 3 11 26 8 6 21 49 49 7 8 32 3 16 10 31 1 2 46 22 12 5 41 50 6 15 8 39 15 33 12 21 30 26 9 8 32 28 23 58 50 29 29 41 53 34 4 21 7 2 16 23 9 14 44 15 31 21 13 36 4 13 40 ...

result:

ok ok (100 test cases)

Test #48:

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

input:

100
1814 3020
1218 1336
1336 527
1014 527
1014 1445
1445 728
1583 728
1583 1718
1718 263
1177 263
1177 386
386 257
1387 257
1387 60
60 927
622 927
622 1004
1004 1719
433 1719
433 476
476 1662
989 1662
989 1538
1538 295
900 295
900 1288
1288 609
292 609
292 1730
1730 1036
689 1036
689 842
842 1596
64...

output:

No
No
No
No
Yes
1 6 15 45 1 11 30 24 28 40 58 7 5 22 50 13 50 39 29 33 10 58 10 26 34 30 73 35 21 58 13 49 70 15 23 20 5 38 37 80 60 64 11 17 41 3 14 12 10 74 47 24 1 19 11 65 5 26 28 46 53 40 8 78 1 70 17 7 23 57 37 52 27 29 24 27 18 46 43 39 21 36 2 22 9 72 57 57 50 32 86 17 20 52 11 40 54 4 24 6 ...

result:

ok ok (100 test cases)

Test #49:

score: 0
Accepted
time: 46ms
memory: 6368kb

input:

400
500 883
1 305
1 134
1 102
1 497
1 235
1 389
1 70
1 119
1 167
1 96
1 31
305 453
305 270
305 447
305 258
305 155
453 496
453 175
453 214
453 474
496 93
496 52
496 373
496 263
496 129
496 491
496 35
270 479
270 410
270 344
270 66
270 80
270 122
479 256
479 141
479 330
479 162
479 160
479 383
134 11...

output:

Yes
1 10 19 13 136 96 19 111 2 6 31 12 76 43 3 127 28 147 30 43 1 70 1 113 8 113 77 1 25 20 164 51 58 71 127 1 67 128 4 20 65 17 58 12 48 127 1 53 120 62 61 4 10 59 153 10 26 86 126 109 131 2 1 7 5 33 29 11 124 138 20 14 36 43 52 1 1 162 35 63 44 7 6 10 93 2 90 78 118 4 8 5 2 2 43 135 92 132 62 7 40...

result:

ok ok (400 test cases)

Test #50:

score: 0
Accepted
time: 38ms
memory: 6420kb

input:

400
473 785
360 240
240 421
175 421
175 169
169 8
443 8
443 9
9 63
406 63
406 377
377 309
68 309
68 85
85 64
3 64
3 105
105 424
62 424
62 179
179 415
349 415
349 274
274 378
72 378
72 454
454 47
403 47
403 270
270 91
189 91
189 27
27 414
199 414
199 381
381 258
242 258
242 408
408 155
252 155
252 17...

output:

No
Yes
1 112 11 21 34 34 95 67 1 6 94 84 125 38 89 31 91 90 1 36 66 8 46 60 39 8 36 32 5 94 1 88 123 53 29 29 70 2 62 14 38 63 1 29 79 40 47 8 20 97 15 42 84 83 62 26 38 93 28 1 41 27 47 44 4 82 71 73 4 20 19 1 75 20 1 91 17 9 79 20 104 28 28 118 84 51 26 50 1 36 120 3 3 40 1 58 49 38 58 52 74 80 77...

result:

ok ok (400 test cases)

Test #51:

score: 0
Accepted
time: 34ms
memory: 6312kb

input:

400
500 1147
1 149
1 103
1 140
1 229
1 425
1 389
1 423
1 194
1 293
1 16
1 479
1 496
1 401
1 269
1 407
1 247
1 212
1 171
1 262
1 397
1 80
1 85
1 75
1 44
1 175
1 258
1 122
1 65
149 32
149 213
149 438
149 286
149 96
149 126
149 200
103 32
103 349
103 119
103 231
103 3
103 489
103 341
103 90
103 126
140...

output:

Yes
1 20 29 8 12 13 7 18 5 7 2 8 8 9 5 9 15 32 21 3 22 25 3 2 8 6 8 21 19 3 11 5 19 21 17 21 3 2 19 10 6 22 15 35 25 24 16 4 14 26 22 3 18 15 10 14 6 19 11 2 5 10 19 1 38 9 6 10 13 4 7 33 14 8 29 3 19 3 20 26 2 13 31 17 29 12 5 5 12 35 1 9 15 7 22 35 2 15 14 7 24 16 2 13 15 1 18 33 27 13 5 33 15 13 ...

result:

ok ok (400 test cases)

Test #52:

score: 0
Accepted
time: 45ms
memory: 6452kb

input:

400
500 1149
1 484
1 71
1 338
1 237
1 187
1 388
1 27
1 296
1 272
1 14
1 445
1 491
1 209
1 457
1 312
1 56
1 5
1 81
1 52
1 345
1 395
1 41
1 199
1 386
1 326
1 339
1 448
1 84
1 360
1 83
484 128
484 436
484 349
484 127
484 478
484 256
484 428
484 466
484 251
484 350
71 63
71 418
71 193
71 186
71 492
71 1...

output:

Yes
1 32 7 12 20 6 29 8 12 5 4 4 4 13 4 12 24 11 11 19 4 34 15 8 19 13 9 9 9 10 12 1 2 14 19 11 2 19 5 14 21 20 2 7 8 31 2 17 11 2 12 22 12 2 4 20 13 15 5 6 3 2 2 5 15 7 31 16 24 2 1 19 18 24 9 18 11 2 5 10 18 12 36 33 12 9 18 19 12 6 9 29 25 5 6 13 17 30 17 4 7 23 18 23 1 8 1 2 2 10 18 10 9 1 30 1 ...

result:

ok ok (400 test cases)

Test #53:

score: 0
Accepted
time: 33ms
memory: 7992kb

input:

1000
200 353
1 62
1 175
1 131
1 173
1 6
1 37
1 94
1 85
1 171
1 39
1 187
1 25
62 199
62 182
62 44
62 65
175 191
175 145
175 13
175 177
175 73
175 124
131 31
131 15
131 2
131 146
131 96
173 31
173 3
173 18
173 180
6 92
6 152
6 139
6 170
31 78
31 30
31 88
31 76
31 97
31 38
191 136
191 115
191 80
191 51...

output:

Yes
1 11 3 32 5 38 5 14 48 1 39 8 17 20 11 27 27 10 19 4 4 4 27 40 65 2 23 19 25 46 1 8 2 22 6 19 35 58 33 1 35 21 35 6 1 37 9 11 1 3 35 1 3 1 37 8 18 6 20 47 1 24 38 17 39 51 1 13 18 1 40 1 52 6 44 57 7 1 20 12 5 5 56 51 28 35 2 44 1 3 1 21 9 23 29 38 58 1 2 14 32 18 2 48 22 52 5 9 1 1 3 33 6 1 3 4...

result:

ok ok (1000 test cases)

Test #54:

score: 0
Accepted
time: 42ms
memory: 5952kb

input:

1000
200 456
1 141
1 138
1 82
1 71
1 149
1 84
1 92
1 74
1 171
1 104
1 146
1 23
1 151
1 123
1 124
1 41
1 199
1 112
1 32
1 90
1 110
1 194
1 97
1 79
1 130
141 159
141 94
141 40
141 91
141 193
141 165
141 51
141 73
141 77
141 24
141 28
141 152
141 131
141 65
141 64
141 128
141 81
138 132
138 145
138 137...

output:

Yes
1 5 6 1 3 1 2 5 7 12 8 1 3 3 5 2 5 7 2 7 2 5 5 10 4 2 6 10 3 12 10 9 5 9 1 2 3 6 11 5 8 1 8 9 1 1 1 5 7 1 8 5 7 1 5 4 4 1 1 8 2 4 4 14 12 2 5 5 10 4 2 6 8 3 3 10 9 1 13 1 14 2 10 2 4 7 6 4 1 10 5 2 10 3 3 6 12 9 10 14 6 4 1 4 6 3 2 3 1 10 11 9 3 7 2 6 3 7 9 5 8 6 8 8 5 2 14 14 8 15 11 2 6 1 2 9 ...

result:

ok ok (1000 test cases)

Test #55:

score: 0
Accepted
time: 45ms
memory: 5908kb

input:

1000
182 300
151 50
50 110
181 110
181 138
138 54
141 54
141 41
41 93
33 93
33 101
101 20
159 20
159 120
120 32
118 32
118 119
119 107
117 107
117 9
9 2
173 2
173 86
86 7
48 7
48 105
105 24
145 24
145 3
3 73
63 73
63 150
150 71
87 71
87 83
83 16
68 16
68 19
19 30
103 30
103 164
164 25
104 25
104 67
...

output:

No
Yes
1 8 5 8 3 6 6 5 2 3 14 2 9 7 1 2 17 11 14 2 11 13 3 1 17 8 4 13 1 11 3 4 3 14 6 12 4 9 16 2 13 14 4 1 7 10 2 6 4 7 4 12 8 15 4 2 4 5 11 4 11 3 7 6 9 7 4 2 4 16 12 1 13 3 3 12 5 8 1 6 3 1 1 13 1 2 1 10 2 3 7 4 1 13 4 2 8 4 17 1 2 12 5 7 6 8 11 10 4 1 5 3 3 1 3 9 2 5 5 5 4 5 4 8 13 8 1 7 10 7 8...

result:

ok ok (1000 test cases)

Test #56:

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

input:

1000
198 461
1 68
1 77
1 163
1 12
1 19
1 196
1 30
1 60
1 28
1 175
1 21
1 115
1 22
1 190
1 87
1 145
1 113
1 78
1 169
1 125
1 155
1 124
1 191
1 139
1 52
1 146
68 103
68 81
68 18
68 34
68 132
68 164
68 40
68 165
68 94
68 193
68 88
68 168
68 49
68 177
68 183
68 178
68 116
68 160
77 37
77 86
77 126
77 19...

output:

Yes
1 3 6 6 2 7 8 12 3 10 1 3 1 7 13 9 1 4 3 8 6 7 2 7 1 3 3 5 3 4 7 7 6 6 4 2 2 4 6 8 4 1 2 4 9 3 1 2 11 3 1 14 1 3 2 1 11 6 1 4 1 5 11 8 3 3 3 1 2 6 3 11 5 2 3 1 2 8 7 3 4 3 7 5 9 3 7 10 9 1 6 9 1 9 2 11 8 10 5 7 4 8 1 7 6 3 1 4 1 7 4 6 8 6 7 13 8 1 5 6 6 5 2 13 11 3 10 9 10 1 1 6 5 3 5 5 8 11 14 ...

result:

ok ok (1000 test cases)

Test #57:

score: 0
Accepted
time: 38ms
memory: 3756kb

input:

4000
46 93
1 42
1 26
1 32
1 23
1 33
1 8
1 22
1 28
1 39
42 14
42 11
42 21
42 4
42 43
26 15
26 11
26 20
26 21
26 43
32 12
32 44
32 31
32 40
32 36
32 27
14 17
14 12
14 44
14 31
14 36
15 9
15 10
15 5
15 24
11 5
11 24
11 30
11 34
20 2
20 7
20 16
21 7
21 45
17 45
17 25
17 16
9 2
9 25
10 29
10 13
10 38
2 1...

output:

Yes
1 2 1 7 4 4 3 9 1 3 2 5 1 1 2 4 2 1 1 3 3 9 7 2 4 1 3 9 1 2 3 2 5 6 4 3 1 3 9 3 2 1 8 3 1 1 
No
Yes
1 11 1 1 1 1 10 1 6 8 10 9 4 6 4 9 9 1 1 2 3 8 4 3 3 7 6 2 5 4 6 8 2 2 2 4 4 10 1 1 4 1 4 4 12 6 4 7 5 1 
No
Yes
1 1 3 5 4 3 1 7 4 2 1 3 2 1 1 7 1 5 1 3 1 4 1 2 4 2 5 5 1 1 3 4 2 2 2 3 5 1 1 1 2 1...

result:

ok ok (4000 test cases)

Test #58:

score: 0
Accepted
time: 31ms
memory: 7892kb

input:

4000
50 111
1 42
1 37
1 8
1 33
1 48
1 30
1 17
1 22
1 21
1 6
1 29
1 24
1 45
42 40
42 39
42 18
42 32
42 34
42 3
42 2
37 39
37 32
37 34
37 25
37 13
8 40
8 3
8 2
8 5
40 11
40 10
40 44
40 12
39 27
39 11
39 46
39 44
33 31
33 19
33 43
33 49
33 35
33 36
33 23
48 49
48 35
48 23
18 14
18 43
27 19
27 49
27 35
...

output:

Yes
1 5 4 2 6 6 1 1 1 1 1 5 4 1 1 1 4 2 1 1 5 5 4 7 4 3 1 1 7 4 1 3 3 3 2 4 1 1 1 1 1 1 1 2 7 2 3 3 1 1 
Yes
1 2 4 6 7 5 1 9 7 2 2 3 2 1 1 6 1 2 5 2 6 1 6 2 2 5 5 4 8 2 4 7 9 8 1 11 4 1 1 1 2 10 6 4 8 2 7 4 4 1 
Yes
1 3 8 9 3 3 6 2 15 3 14 5 7 1 12 3 11 2 1 1 1 4 9 1 2 16 1 7 8 15 9 1 2 2 1 2 10 10 ...

result:

ok ok (4000 test cases)

Test #59:

score: 0
Accepted
time: 34ms
memory: 5736kb

input:

4000
44 70
32 33
33 23
6 23
6 27
27 18
40 18
40 14
14 4
9 4
9 36
36 28
37 28
37 21
21 19
43 19
43 22
22 20
30 20
30 35
35 26
24 26
24 3
3 39
29 39
29 16
16 12
17 12
17 15
15 10
13 10
13 31
31 7
11 7
11 34
34 41
2 41
2 8
8 42
5 42
5 38
38 25
32 25
1 32
23 44
1 6
18 44
1 40
4 44
1 9
28 44
1 37
19 44
1...

output:

No
Yes
1 9 3 1 2 5 6 8 4 2 10 12 10 7 5 9 4 10 5 15 4 7 2 1 11 1 1 13 12 11 2 3 1 16 1 1 8 10 8 1 1 4 2 5 1 6 12 1 
Yes
1 1 1 1 2 1 4 2 1 1 2 1 4 3 1 2 3 7 4 4 1 2 1 2 4 1 5 6 2 6 1 3 3 1 4 1 5 2 2 3 4 3 7 3 6 4 1 1 2 1 
Yes
1 3 14 5 9 2 1 8 3 1 1 1 3 14 14 5 4 1 1 5 1 11 1 6 4 6 3 1 1 7 1 6 1 8 7 8...

result:

ok ok (4000 test cases)

Test #60:

score: 0
Accepted
time: 33ms
memory: 5792kb

input:

4000
50 108
1 32
1 4
1 16
1 19
1 13
1 12
1 43
1 11
1 27
1 24
1 2
1 49
1 34
1 3
1 9
32 48
32 33
32 21
32 8
32 44
32 20
32 28
32 37
4 48
4 33
4 8
4 44
4 28
4 37
16 40
16 25
16 38
16 10
16 23
16 14
19 35
19 25
19 36
19 38
19 10
13 40
13 5
13 31
13 36
13 38
48 35
48 31
48 10
33 5
33 29
12 39
12 6
43 39
...

output:

Yes
1 5 7 1 1 4 2 3 7 4 3 3 2 5 1 2 2 3 2 4 2 1 4 5 1 1 4 4 4 1 2 1 1 6 1 2 6 2 4 1 1 2 3 3 2 1 3 1 6 1 
No
No
Yes
1 10 9 6 3 5 2 3 10 6 1 6 1 1 2 3 3 3 9 1 1 3 1 3 2 2 1 15 3 5 1 2 8 14 1 10 6 1 6 1 7 3 3 13 1 11 5 7 7 1 
Yes
1 3 7 3 2 6 1 6 5 5 1 4 2 2 2 5 4 3 6 5 3 4 3 6 4 1 4 1 5 2 2 1 1 2 1 5 3...

result:

ok ok (4000 test cases)

Extra Test:

score: 0
Extra Test Passed