QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#511986#9177. String and Nailsucup-team3636#AC ✓187ms9436kbC++20447b2024-08-10 13:10:372024-08-10 13:10:37

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3508kb

input:

3
1 1
2 4
3 1

output:

YES
1 1
3 1

result:

ok Everything ok

Test #2:

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

input:

1
1000000000 0

output:

YES

result:

ok Everything ok

Test #3:

score: 0
Accepted
time: 178ms
memory: 9436kb

input:

200000
500000000 500000000
500244009 499720246
500488018 499440492
500732027 499160738
500976036 498880984
501220045 498601230
501464054 498321476
501708063 498041722
501952072 497761968
502196081 497482214
502440090 497202460
502684099 496922706
502928108 496642952
503172117 496363198
503416126 496...

output:

YES
548557791 444328954
548313782 444608708
548069773 444888462
547825764 445168216
547581755 445447970
547337746 445727724
547093737 446007478
546849728 446287232
546605719 446566986
546361710 446846740
546117701 447126494
545873692 447406248
545629683 447686002
545385674 447965756
545141665 448245...

result:

ok Everything ok

Test #4:

score: 0
Accepted
time: 165ms
memory: 9360kb

input:

200000
500000000 500000000
500222156 499645622
500444312 499291244
500666468 498936866
500888624 498582488
501110780 498228110
501332936 497873732
501555092 497519354
501777248 497164976
501999404 496810598
502221560 496456220
502443716 496101842
502665872 495747464
502888028 495393086
503110184 495...

output:

YES
544209044 429478778
543986888 429833156
543764732 430187534
543542576 430541912
543320420 430896290
544563422 429700934
543098264 431250668
544341266 430055312
542876108 431605046
544119110 430409690
542653952 431959424
543896954 430764068
542431796 432313802
543674798 431118446
544917800 429923...

result:

ok Everything ok

Test #5:

score: 0
Accepted
time: 170ms
memory: 9240kb

input:

200000
500000000 500000000
500000000 499720246
500000000 499440492
500000000 499160738
500000000 498880984
500000000 498601230
500000000 498321476
500000000 498041722
500000000 497761968
500000000 497482214
500000000 497202460
500000000 496922706
500000000 496642952
500000000 496363198
500000000 496...

output:

YES
500000000 444328954
500000000 444608708
500279754 444328954
500000000 444888462
500279754 444608708
500559508 444328954
500000000 445168216
500279754 444888462
500559508 444608708
500839262 444328954
500000000 445447970
500279754 445168216
500559508 444888462
500839262 444608708
501119016 444328...

result:

ok Everything ok

Test #6:

score: 0
Accepted
time: 162ms
memory: 9372kb

input:

200000
500000000 500000000
500040773 499984682
500081546 499969364
500122319 499954046
500163092 499938728
500203865 499923410
500244638 499908092
500285411 499892774
500326184 499877456
500366957 499862138
500407730 499846820
500448503 499831502
500489276 499816184
500530049 499800866
500570822 499...

output:

YES
500000000 500000000
500040773 499984682
500081546 499969364
500015318 500040773
500122319 499954046
500056091 500025455
500163092 499938728
500096864 500010137
500030636 500081546
500203865 499923410
500137637 499994819
500071409 500066228
500244638 499908092
500178410 499979501
500112182 500050...

result:

ok Everything ok

Test #7:

score: 0
Accepted
time: 157ms
memory: 9432kb

input:

200000
500000000 500000000
500003221 499984460
500006442 499968920
500009663 499953380
500012884 499937840
500016105 499922300
500019326 499906760
500022547 499891220
500025768 499875680
500028989 499860140
500032210 499844600
500035431 499829060
500038652 499813520
500041873 499797980
500045094 499...

output:

YES
564416779 189215540
564413558 189231080
564432319 189218761
564410337 189246620
564429098 189234301
564407116 189262160
564447859 189221982
564425877 189249841
564403895 189277700
564444638 189237522
564422656 189265381
564463399 189225203
564400674 189293240
564441417 189253062
564419435 189280...

result:

ok Everything ok

Test #8:

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

input:

100
29 58
10 60
7 34
47 47
48 29
37 25
30 42
47 32
60 28
0 2
53 1
42 32
3 34
52 24
45 7
32 60
40 1
15 22
60 43
17 19
17 54
24 22
21 38
37 26
11 46
18 59
27 18
11 19
34 14
8 16
50 38
29 10
34 59
5 28
14 36
34 41
57 53
25 8
17 0
35 5
60 52
36 10
38 8
50 41
38 18
45 39
44 16
33 21
18 19
51 25
35 58
49 ...

output:

YES
0 2
0 9
1 13
17 0
17 4
3 20
9 14
2 22
8 16
1 24
8 17
2 25
11 19
27 4
5 28
25 8
28 7
17 19
3 34
15 22
18 19
6 32
16 23
20 19
29 10
35 5
7 34
40 1
16 26
1 43
27 18
24 22
36 10
38 8
34 13
34 14
18 31
19 30
49 0
14 36
21 31
45 7
2 52
33 21
53 1
21 34
16 40
38 18
11 46
30 28
21 38
44 16
21 41
37 25
3...

result:

ok Everything ok

Test #9:

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

input:

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

output:

YES
2 1
4 1
5 0
6 0
4 9
4 10
10 10
11 9
8 14
17 7
23 1
6 20
7 19
10 18
0 29
12 17
10 21
3 29
22 10
32 0
0 33
16 20
20 16
31 6
36 4
12 29
33 8
15 28
33 11
38 7
31 15
45 1
17 30
44 3
12 36
36 12
2 47
36 14
20 31
22 29
30 21
14 38
49 4
18 36
2 53
14 41
36 20
41 16
51 7
13 46
21 38
31 28
37 23
17 45
29 ...

result:

ok Everything ok

Test #10:

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

input:

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

output:

YES
3 0
9 0
8 4
12 1
13 8
2 22
6 18
22 6
9 21
16 17
22 12
8 27
19 16
30 5
33 5
11 28
17 22
26 13
39 0
5 35
8 32
27 15
18 26
32 14
37 10
8 40
42 6
27 24
6 46
9 44
13 41
25 29
26 29
51 4
24 32
11 46
43 15
44 14
56 2
44 15
21 39
25 35
7 55
19 43
45 17
59 3
34 29
48 15
11 53
41 23
23 42
58 7
15 51
26 40...

result:

ok Everything ok

Test #11:

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

input:

100
60 19
19 20
36 57
54 36
40 17
45 45
32 49
58 41
47 28
26 28
38 48
39 24
24 43
30 8
53 45
12 2
35 30
54 19
33 0
36 24
60 8
2 27
1 25
0 59
13 13
47 52
22 60
6 36
54 51
25 8
52 51
57 9
39 45
51 41
6 51
32 43
52 40
57 39
4 4
36 6
9 18
21 13
50 1
50 33
38 29
31 53
47 37
56 45
53 21
13 34
1 23
42 18
3...

output:

YES
4 4
12 2
1 23
1 25
13 13
9 18
12 15
2 27
29 1
25 8
33 0
21 13
31 5
5 32
30 7
30 8
19 20
12 28
6 36
35 7
36 6
15 28
44 1
31 15
8 39
11 36
13 34
48 0
43 6
5 45
7 43
48 2
50 1
16 36
49 4
18 36
26 28
21 34
53 3
6 51
40 17
0 59
17 43
36 24
42 18
43 17
15 46
39 24
29 35
12 53
27 38
35 30
57 9
24 43
38...

result:

ok Everything ok

Test #12:

score: 0
Accepted
time: 119ms
memory: 9372kb

input:

200000
658 517
723 846
391 133
564 468
633 202
556 954
760 456
151 969
436 184
984 490
896 355
871 985
101 474
136 92
220 747
833 272
839 145
783 485
78 888
819 829
177 209
233 546
709 414
105 273
955 945
748 593
182 181
160 645
532 327
491 354
512 24
190 152
147 539
476 300
474 289
478 772
157 853
...

output:

YES
1 1
2 1
1 3
1 4
3 4
7 0
1 7
4 4
3 6
9 0
5 6
1 11
10 2
7 6
7 7
0 15
5 10
10 5
4 13
8 9
9 8
14 3
15 2
2 16
3 15
5 13
8 10
9 9
17 1
9 10
10 9
12 7
14 5
16 3
18 1
2 18
14 6
15 5
5 16
6 15
8 13
12 9
16 5
18 3
10 12
15 7
17 5
20 2
21 1
5 18
18 5
20 3
6 18
9 15
18 6
21 3
23 1
1 25
6 20
9 17
10 16
20 6
...

result:

ok Everything ok

Test #13:

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

input:

200000
378 842
689 0
407 360
925 706
35 241
517 296
157 365
379 630
234 828
370 628
28 136
367 483
546 638
995 367
901 983
479 253
812 610
454 878
250 0
618 535
221 325
346 583
470 440
997 887
197 643
613 711
687 194
468 519
837 984
844 159
220 857
101 701
120 531
391 802
361 11
519 944
370 285
766 ...

output:

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

result:

ok Everything ok

Test #14:

score: 0
Accepted
time: 103ms
memory: 9364kb

input:

200000
860 546
26 774
422 975
277 563
812 661
98 259
937 887
599 299
41 472
376 385
154 919
855 361
229 191
472 22
572 217
506 227
15 75
116 501
803 733
799 860
893 53
459 238
223 848
127 889
821 952
105 439
182 960
529 12
761 640
824 576
920 681
631 241
85 531
314 542
240 734
933 124
972 710
593 79...

output:

YES
0 0
1 0
0 3
1 3
3 1
3 2
4 1
5 0
3 3
4 2
5 1
6 0
4 3
6 1
5 3
1 8
4 5
8 1
9 0
5 5
8 2
10 0
4 7
7 4
9 2
11 0
2 10
8 4
7 6
9 4
10 3
3 11
4 10
5 9
6 8
8 6
0 15
5 10
7 8
8 7
15 0
8 8
14 2
15 1
0 17
10 7
4 14
6 12
7 11
11 7
0 19
2 17
8 11
11 8
2 18
4 16
6 14
0 21
1 20
3 18
9 12
18 3
3 19
12 10
1 22
2 2...

result:

ok Everything ok

Test #15:

score: 0
Accepted
time: 170ms
memory: 9260kb

input:

200000
824175840 488750041
893673855 438646868
506562578 184637200
761446161 4953165
923499503 652902113
817153029 230202371
946810300 303530617
906604390 328096095
697686565 540398115
228789229 425571938
208244496 326466740
966638889 820582012
90257817 655318977
216563076 98765025
574316317 6924138...

output:

YES
1770923 1101007
163507 2981257
736131 4347538
4595473 528364
2836094 3253840
1337708 5256034
4894736 1990731
4465729 2668925
5319428 2632110
5067900 3861227
4630983 5532449
9497674 773129
2844884 7542989
3754868 7352026
11382081 422395
6267133 6669558
5577177 8828708
4957252 9710961
6512859 8439...

result:

ok Everything ok

Test #16:

score: 0
Accepted
time: 164ms
memory: 9368kb

input:

200000
1433020 626069928
229180372 161196849
900502139 7107082
972307164 933305447
771737287 191739450
323730061 8183918
949678944 490542724
523994382 985258262
953870673 374422949
96559137 217074405
627267233 174567394
573638149 400359707
141414987 321531687
809839237 701887439
316867805 708592231
...

output:

YES
177274 1341629
3282177 1854515
3559944 2139722
2918785 3325956
559009 6819170
2748265 5003831
6432767 1383335
7188250 713569
6287225 2295622
7621096 1635588
9388396 344915
3504723 6494320
1788600 8367308
6494184 4040193
10171172 597090
2309376 9345501
8183223 3576651
3047355 8979969
11069462 976...

result:

ok Everything ok

Test #17:

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

input:

5
0 1000000000
1000000000 0
0 0
1000000000 1000000000
500000000 500000000

output:

YES
0 0
0 1000000000
500000000 500000000
1000000000 0

result:

ok Everything ok

Test #18:

score: 0
Accepted
time: 176ms
memory: 9364kb

input:

200000
178690201 763389816
228250401 473681415
925845481 534609673
814571948 566690436
30040488 435609496
125274385 81132757
247514879 898893195
67755446 273824208
841458560 282076711
669361754 713609582
46289970 432733465
107008482 685170111
487539449 987744399
108148105 83671488
722982805 72477062...

output:

YES
4293846 15352
1625819 2926503
2089792 2814995
4010058 1309964
4633722 728816
1041422 4646353
732111 5408933
3122769 3149072
6828170 437889
449380 7216207
8827597 569054
7294468 2172987
9833362 673649
6540710 4185792
8490967 2349948
1745178 10130621
4261346 8015087
7859248 5458969
6228785 7235387...

result:

ok Everything ok

Test #19:

score: 0
Accepted
time: 170ms
memory: 9436kb

input:

200000
60980090 900709703
858724210 491198688
319785041 430708482
25432950 790010009
878278273 384512251
926818709 490518084
176754595 380872594
685145439 562390155
24013739 116101546
537131662 136515830
833908927 617270608
8975034 264947807
833663911 990393598
406456974 391826610
170567002 74094902...

output:

YES
1359407 7560
1633500 3070552
6637314 485273
6448272 906022
6945850 999029
9365334 268743
1278673 8679401
5010540 5052450
198946 10380422
6485769 4468218
58072 13261620
2187061 12172683
1022184 13471086
9117161 5624957
6757190 8478768
854918 14389273
7176379 8187458
1053995 14410850
3116261 12502...

result:

ok Everything ok

Test #20:

score: 0
Accepted
time: 187ms
memory: 9408kb

input:

200000
943269980 38029589
857794239 582344890
713724603 253178364
572730442 718362290
726516058 923349589
728363033 563466923
179623240 789223065
933939212 555988811
575165138 655159089
404901571 633051007
957964373 170403969
910941587 918354431
884821081 656606308
999733135 363545243
281714710 9784...

output:

YES
722043 1917226
2552686 745293
3337935 1632411
4101610 1985582
2535495 3581464
5167853 1075537
611006 6925014
5283628 2700381
4985252 3289154
5171762 4290069
4073735 5666422
977229 9291943
3489024 6856057
3818875 8432670
9913121 2833844
11856528 1121999
8179473 5788032
10517918 3506013
10005409 4...

result:

ok Everything ok

Test #21:

score: 0
Accepted
time: 159ms
memory: 9412kb

input:

200000
415494452 470316769
193300756 599862164
34035236 780680955
709962518 351747279
279786550 167219634
529907356 46481178
477459176 271202463
182732984 844554758
757720317 857780143
977704188 129586183
376987109 723537332
107875431 498132126
230945542 322819018
298042004 376733073
319233490 99464...

output:

YES
662227 3831569
706594 3855365
2036198 4009466
336717 6711070
4789109 4137772
7841878 1299404
1194954 8562876
332641 9950457
3336671 7180426
2990342 10079572
4883466 8187505
7424776 6154480
12204485 2148989
14731812 179918
10549908 4506625
8083871 7919780
9104813 7728969
666347 17085641
10320124 ...

result:

ok Everything ok

Test #22:

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

input:

100
500000000 500000000
500000000 489443908
500000000 478887816
500000000 468331724
500000000 457775632
500000000 447219540
500000000 436663448
500000000 426107356
500000000 415551264
500000000 404995172
510556092 500000000
510556092 489443908
510556092 478887816
510556092 468331724
510556092 457775...

output:

YES
500000000 404995172
500000000 415551264
510556092 404995172
500000000 426107356
510556092 415551264
521112184 404995172
500000000 436663448
510556092 426107356
521112184 415551264
531668276 404995172
500000000 447219540
510556092 436663448
521112184 426107356
531668276 415551264
542224368 404995...

result:

ok Everything ok

Test #23:

score: 0
Accepted
time: 148ms
memory: 9188kb

input:

200000
571121104 497369632
424233472 502802176
635651583 494983014
459708961 501490138
627796261 495273538
615283564 495736312
535668814 498680812
639758509 494831122
592923243 496563294
523187049 499142442
426839493 502705794
378712816 504485728
394223105 503912090
581741325 496976850
619310348 495...

output:

YES
359400703 505199974
359403515 505199870
359404921 505199818
359405624 505199792
359407030 505199740
359408436 505199688
359409842 505199636
359411951 505199558
359414060 505199480
359416169 505199402
359417575 505199350
359418278 505199324
359418981 505199298
359422496 505199168
359423902 505199...

result:

ok Everything ok

Extra Test:

score: 0
Extra Test Passed