QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#860669#9975. Hitoshizukuucup-team4707#AC ✓95ms25804kbC++202.9kb2025-01-18 14:26:462025-01-18 14:29:27

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

2
2
1 2
2 2
2 3
3 5
4 4
4 5
1
1 1
1 1000000000
1000000000 1000000000

output:

Yes
1 2 3 
5 4 6 
No

result:

ok >_< (2 test cases)

Test #2:

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

input:

100000
1
164154503 167959139
178382610 336470888
12298535 642802746
1
165064830 773386884
353585658 396628655
792066242 971207868
1
1607946 2087506
21674839 46761498
9518201 16843338
1
262361007 691952768
190585553 787375312
637191526 693319712
1
41970708 45277106
197619816 762263554
308360206 40724...

output:

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

result:

ok >_< (100000 test cases)

Test #3:

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

input:

50000
2
36364670 641009859
15071436 75475634
20446080 476927808
357784519 503158867
206641725 322595515
268011721 645468307
2
247717926 939887597
808609669 973764525
496738491 710156469
463547010 860350786
757388873 784695957
29903136 208427221
2
26681139 67590963
458238185 475357775
80127817 135993...

output:

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

result:

ok >_< (50000 test cases)

Test #4:

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

input:

33333
3
405068225 524125987
162463453 374288891
493199993 751244358
111234434 232930851
71448581 543529670
158749276 319728747
238956600 582720391
320275833 490702144
111160223 138628383
3
23006185 733781508
636477523 931759705
585852932 723534730
388969099 794937524
153929016 188451996
7487968 1448...

output:

No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
Yes
4 2 5 
6 8 3 
9 7 1 
No
No
Yes
2 7 5 
4 3 9 
6 1 8 
No
No
No
Yes
1 4 2 
5 7 9 
6 8 3 
Yes
1 6 8 
2 4 9 
3 7 5 
No
Yes
2 4 6 
5 9 3 
8 1 7 
Yes
2 6 3 
7 5 4 
8 9 1 
No
No
No
Yes
1 9 4 
5 8 2 
7 3 6 
No
No
No
Yes
3 2 1 
5 8 7 
9 6 4 
No
Y...

result:

ok >_< (33333 test cases)

Test #5:

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

input:

25000
4
387784488 702209411
329025563 673102149
394641352 730593611
244761087 812959730
198875143 469496529
425799311 699021890
715498963 815487777
765027712 857896659
160339866 421876106
477145912 902179526
264824816 783856158
26239891 238642240
4
588094643 962475573
90297216 196513513
234289482 33...

output:

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

result:

ok >_< (25000 test cases)

Test #6:

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

input:

20000
5
255424772 585325539
298257969 412106895
366545795 564718673
426199147 837699009
609084202 690430685
367932561 373282330
488491851 753287868
18693151 79866982
629564684 850348020
7594098 480642952
376090136 930919906
592321264 903492853
345689007 984789430
895853014 909607734
122083425 211655...

output:

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

result:

ok >_< (20000 test cases)

Test #7:

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

input:

16666
6
26845100 58376259
4489038 5887448
307580079 544067926
473165155 712695184
842055718 911364840
851679243 902318577
17646538 250896470
562282480 742028793
60193924 133595743
573222241 649040970
189379234 223207847
301595726 418600362
105036855 417168695
446368438 622701955
89667978 235369723
2...

output:

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

result:

ok >_< (16666 test cases)

Test #8:

score: 0
Accepted
time: 48ms
memory: 5844kb

input:

14285
7
498283426 941492387
435838088 449924898
60069608 378192988
2943111 147499872
449114197 837331700
157821356 576579017
175187302 188696560
119961285 669031820
613970072 826908873
631375408 817438988
79062948 370271596
137867063 638740575
161249104 439482552
40882880 335796176
97823227 25908403...

output:

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

result:

ok >_< (14285 test cases)

Test #9:

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

input:

12500
8
109970553 824608515
38308643 43705451
617662368 652509537
56888590 317463343
17277529 58265855
96899941 250839457
10202459 126496650
221863474 331193631
98584951 255380788
66986639 690869710
118913405 222368048
3832128 8623893
411234159 461796409
101768229 194114590
63466173 137574156
159144...

output:

No
No
Yes
1 5 16 
6 2 19 
7 23 14 
11 12 3 
18 10 13 
20 15 8 
21 17 22 
24 9 4 
No
No
No
Yes
3 4 16 
5 14 6 
8 2 23 
9 18 1 
10 22 24 
13 21 19 
15 11 20 
17 12 7 
Yes
1 5 6 
8 22 11 
9 17 13 
14 18 20 
16 15 19 
21 12 4 
23 2 3 
24 10 7 
No
Yes
5 2 22 
7 12 10 
9 11 6 
13 24 3 
14 21 8 
17 1 16 
1...

result:

ok >_< (12500 test cases)

Test #10:

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

input:

11111
9
1107549 2691939
298974391 782710197
175975837 631858791
80573957 752268030
44807884 279200011
318005100 630132600
130445116 769329445
230959195 258196658
67434329 538628510
126840838 859267729
426717264 514655989
280881449 523731402
150265596 189142970
138881978 907208811
12171267 161288468
...

output:

No
Yes
4 13 22 
9 11 6 
12 8 14 
16 21 2 
18 15 5 
19 26 1 
23 7 27 
24 3 10 
25 20 17 
Yes
1 12 8 
3 22 7 
5 4 24 
13 11 2 
14 9 25 
15 6 16 
18 10 23 
19 17 21 
20 27 26 
No
Yes
1 3 20 
6 17 22 
11 19 23 
12 5 18 
13 14 15 
16 4 27 
21 7 9 
24 25 2 
26 10 8 
Yes
3 27 6 
5 20 22 
9 4 18 
15 8 21 
1...

result:

ok >_< (11111 test cases)

Test #11:

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

input:

10000
10
419583132 802030518
503473132 640274071
29114694 71550121
266502879 799843967
519878600 796619138
109163155 223219513
173801057 312183499
295274161 673542337
569813861 879397647
566104761 631413076
40006012 579868000
45494915 126195703
211345072 535526356
507966667 653535984
868289731 87922...

output:

No
No
No
No
No
No
Yes
5 17 27 
6 8 13 
7 9 1 
12 16 30 
14 3 23 
15 24 2 
20 28 10 
21 11 25 
22 19 26 
29 4 18 
No
No
No
No
No
No
No
Yes
2 29 14 
6 1 5 
8 4 3 
19 30 24 
20 9 16 
22 7 17 
23 13 15 
25 28 12 
26 21 10 
27 11 18 
No
Yes
1 18 23 
3 29 13 
4 15 21 
6 20 7 
8 26 27 
11 22 30 
12 25 17 
...

result:

ok >_< (10000 test cases)

Test #12:

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

input:

5000
20
248930144 452405440
28850950 509061481
11675144 16115810
46552920 66743034
250304676 677780684
13100349 208050516
401412088 954478790
27263447 387546138
341164513 641889899
343680066 717802881
119096072 661699500
675285710 759454419
90875780 255743179
294553111 694729965
146519548 862937826
...

output:

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

result:

ok >_< (5000 test cases)

Test #13:

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

input:

2500
40
30078839 43603670
585409830 661220621
47019446 315312595
195376102 450798063
12047273 30038366
6365574 32488330
44528676 63719100
45395244 370843342
42359492 166874404
189032198 330773980
229782995 560521283
338711259 466163339
486437793 995663034
47493303 362533606
574415501 975584927
63051...

output:

Yes
1 102 75 
4 106 115 
6 92 45 
11 81 44 
12 36 73 
19 10 70 
20 100 68 
21 80 5 
22 16 114 
27 41 18 
30 108 64 
33 116 78 
35 107 66 
38 23 79 
40 72 43 
42 117 109 
46 67 34 
52 3 95 
53 49 90 
54 97 62 
55 31 88 
56 99 69 
57 86 76 
58 74 112 
59 28 98 
63 50 2 
65 17 24 
71 47 85 
82 104 48 
...

result:

ok >_< (2500 test cases)

Test #14:

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

input:

2000
50
167005 134170081
119263013 235040736
359376356 405102476
368254760 567954026
142560899 351391400
52465572 872095141
5895182 116079799
503946453 935104039
624910603 779623552
407602577 857355273
104834774 642352783
377070248 394389351
7487217 10847154
78697148 403727586
19118138 104520573
302...

output:

No
Yes
6 44 52 
9 106 117 
11 121 5 
13 19 24 
15 97 142 
16 78 38 
17 83 118 
29 26 103 
31 1 63 
34 132 86 
35 72 140 
36 108 150 
40 51 135 
41 14 28 
46 143 67 
50 116 92 
55 87 7 
57 21 136 
60 10 58 
65 101 43 
71 98 145 
74 110 37 
75 66 54 
76 61 30 
82 120 73 
88 23 39 
90 12 27 
94 91 139 ...

result:

ok >_< (2000 test cases)

Test #15:

score: 0
Accepted
time: 57ms
memory: 5968kb

input:

200
500
240044454 570226789
326748706 906240738
59915230 229227123
25870484 122983289
308323481 491439677
331521117 542348836
79780138 236140577
37215732 400441450
491421004 505626478
41928148 79419397
196402648 681911017
108323645 778854244
168295325 331859787
204653768 764539434
3525633 67848640
2...

output:

Yes
7 170 531 
9 866 1275 
11 874 833 
14 319 69 
16 771 402 
17 407 512 
22 922 469 
34 328 458 
35 209 403 
53 763 920 
54 1392 908 
59 389 671 
60 89 557 
61 787 806 
62 179 721 
64 589 1367 
67 1484 66 
68 1162 1253 
72 15 1092 
74 291 850 
77 556 717 
78 1103 243 
79 841 203 
80 1149 1143 
85 1...

result:

ok >_< (200 test cases)

Test #16:

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

input:

20
5000
239015031 756662829
107482861 164615679
141286392 176745065
711024070 930641599
203753862 992714840
535460189 890646201
120990575 828015603
80241903 245741385
71064502 937343509
255954224 804090603
241085164 265947390
573467935 767999938
9086606 20283091
44079769 135162900
195630455 72443138...

output:

Yes
1 9172 10781 
4 6965 709 
6 11476 5488 
7 3026 9426 
9 2213 6882 
12 10095 6414 
15 4219 14334 
18 14959 11611 
22 1670 5015 
24 9342 14720 
28 3601 13466 
29 2788 11774 
31 1415 13675 
33 10476 3726 
37 9221 12877 
38 10955 5687 
44 4511 4959 
50 10677 8445 
53 13005 9669 
54 5827 2766 
56 9258...

result:

ok >_< (20 test cases)

Test #17:

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

input:

2
50000
134099372 138717692
88497176 203623137
28400878 531963161
491599270 508595246
656123949 690513632
506593350 840717696
75151479 190312317
138082662 708771391
441148125 893057843
452806396 741239078
42068396 78667991
585159549 926735558
695533088 854308946
676238139 709752322
416586658 6449615...

output:

No
No

result:

ok >_< (2 test cases)

Test #18:

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

input:

1
100000
168698075 217141764
51605261 710454586
17380477 789075415
570367 24849107
469495633 685675008
559954719 839804815
332883788 638763480
12087643 327755609
8406881 43827967
108436258 390187172
266381263 301370841
563550486 622696676
204362703 598237196
218501304 232099091
198720699 211987715
7...

output:

Yes
1 142540 257372 
2 64778 101235 
5 243532 115157 
7 145131 11316 
8 268783 276767 
16 249273 82812 
17 254052 121206 
18 227438 284637 
19 121551 147095 
22 94804 146485 
27 137288 28712 
32 177793 275931 
35 293609 28077 
39 159615 19847 
40 37221 271404 
41 83135 181518 
42 266687 255272 
43 2...

result:

ok >_< (1 test case)

Test #19:

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

input:

333
300
499999940 500000540
499999880 500000480
499999882 500000482
500000108 500000110
499999706 500000306
500000286 500000288
499999742 500000342
500000500 500000502
499999773 500000373
500000184 500000186
500000090 500000092
500000010 500000012
499999640 500000240
499999830 500000430
499999945 50...

output:

Yes
1 676 619 
6 309 530 
7 765 408 
13 785 267 
14 308 251 
26 882 335 
28 364 212 
37 681 225 
45 398 685 
48 191 584 
50 207 190 
52 469 23 
58 839 540 
59 778 200 
62 738 246 
64 767 705 
66 467 206 
67 725 659 
69 762 43 
74 457 440 
78 261 436 
81 122 321 
83 65 173 
84 249 647 
88 438 721 
92...

result:

ok >_< (333 test cases)

Test #20:

score: 0
Accepted
time: 74ms
memory: 6992kb

input:

20
5000
500004916 500004918
499994554 500004554
499994653 500004653
500008346 500008348
499990052 500000052
499998337 500008337
499991225 500001225
500008078 500008080
500001210 500001212
500008800 500008802
499992103 500002103
500007998 500008000
500006906 500006908
499994207 500004207
500009454 50...

output:

Yes
2 6490 12246 
4 6527 6459 
8 8872 11839 
9 14629 7260 
10 11747 4940 
15 6817 14203 
24 12150 7090 
29 13138 1800 
34 9572 3396 
39 491 6576 
41 3472 3286 
43 1421 8054 
46 6297 10419 
47 7655 13578 
51 14171 7566 
52 9462 4488 
53 12159 1983 
54 2034 1995 
57 5795 7864 
60 392 2921 
63 5440 117...

result:

ok >_< (20 test cases)

Test #21:

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

input:

10
10000
499997582 500017582
499994226 500014226
499999146 500019146
499986192 500006192
500006688 500006690
500005454 500005456
500012694 500012696
499994423 500014423
500018252 500018254
499984238 500004238
500019624 500019626
500002666 500002668
499981309 500001309
499984412 500004412
499989582 5...

output:

Yes
3 10295 2435 
4 25577 7031 
7 4415 1398 
12 3545 3145 
14 28171 7830 
25 28115 6604 
27 9137 22681 
29 20190 3692 
30 26223 23878 
31 2427 27696 
32 23795 16007 
36 130 24015 
38 14497 2066 
44 13370 22405 
48 17259 11259 
51 26056 10068 
52 6088 24251 
53 26387 6948 
55 23584 7005 
56 16725 529...

result:

ok >_< (10 test cases)

Test #22:

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

input:

1
100000
500195974 500195976
499821737 500021737
500032078 500032080
499844833 500044833
500004644 500004646
499896575 500096575
499837203 500037203
500162180 500162182
499803443 500003443
499903390 500103390
499997619 500197619
499983152 500183152
499851444 500051444
500124540 500124542
500090666 5...

output:

Yes
1 112015 184758 
3 76940 140580 
8 236174 207007 
14 99627 211837 
16 111544 179408 
18 103239 158935 
26 188565 42283 
27 204535 224886 
28 34177 271681 
31 250222 21844 
32 280268 48097 
33 200914 107292 
40 26728 46790 
41 124144 216539 
42 99259 276833 
47 122719 42056 
49 250070 27914 
53 1...

result:

ok >_< (1 test case)

Test #23:

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

input:

333
300
499999677 500000277
499999937 500000537
499999927 500000527
500000186 500000187
500000577 500000580
499999970 500000570
499999688 500000288
499999779 500000379
499999825 500000425
500000503 500000506
499999429 500000029
499999795 500000395
500000251 500000254
499999853 500000453
499999792 50...

output:

No
Yes
5 691 244 
10 889 149 
11 366 744 
16 862 111 
17 377 880 
18 256 714 
19 171 176 
21 182 580 
27 495 450 
29 164 853 
31 810 100 
32 842 694 
33 733 355 
34 121 829 
40 449 334 
42 569 896 
43 429 754 
47 799 399 
48 885 306 
51 180 710 
52 3 400 
53 342 777 
55 686 726 
60 67 548 
61 606 43...

result:

ok >_< (333 test cases)

Test #24:

score: 0
Accepted
time: 95ms
memory: 23756kb

input:

1
100000
500191010 500191012
499836328 500036328
499951243 500151243
499935598 500135598
499898653 500098653
499956171 500156171
500101528 500101529
499800616 500000616
500107541 500107543
500158180 500158181
499825597 500025597
500175739 500175742
500076543 500076545
499970418 500170418
500014716 5...

output:

Yes
1 6189 37060 
2 18935 47094 
7 71757 243341 
9 106024 229698 
12 146466 20849 
15 272553 211694 
17 75577 77440 
19 177281 146976 
20 60864 52426 
23 121658 43116 
26 125252 67497 
30 197920 142393 
34 182048 275646 
36 238438 172015 
44 217400 55017 
45 121922 77404 
47 33567 82267 
55 286378 1...

result:

ok >_< (1 test case)

Extra Test:

score: 0
Extra Test Passed