QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#670321#3043. Lexicographically Minimum WalkMaMengQiTL 219ms31516kbC++201.2kb2024-10-23 21:18:432024-10-23 21:18:43

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

3 3 1 3
1 2 1
2 3 7
1 3 5

output:

1 7 

result:

ok single line: '1 7 '

Test #2:

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

input:

3 4 1 3
1 2 1
2 1 2
2 3 7
1 3 5

output:

TOO LONG

result:

ok single line: 'TOO LONG'

Test #3:

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

input:

2 0 2 1

output:

IMPOSSIBLE

result:

ok single line: 'IMPOSSIBLE'

Test #4:

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

input:

4 4 1 4
1 2 3
2 3 1
3 1 6
3 4 5

output:

3 1 5 

result:

ok single line: '3 1 5 '

Test #5:

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

input:

2 1 2 1
2 1 7

output:

7 

result:

ok single line: '7 '

Test #6:

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

input:

2 2 1 2
1 2 2
2 1 1

output:

2 

result:

ok single line: '2 '

Test #7:

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

input:

28859 86572 9295 11138
20786 10116 517787813
15575 14210 496341115
3830 4061 197006194
17520 5640 491762666
5140 21769 335255632
1656 6657 593849630
22703 267 432722157
24447 19519 787542727
19699 8688 505772317
1872 4189 209599628
12873 21023 303869213
16428 25691 369100452
24666 22655 490450477
69...

output:

276564833 747181428 245358434 243885332 117499601 619812353 284290651 299304374 902348522 88409440 269505876 35537697 270772809 386354731 507174655 86955126 25262475 233484277 978898295 176709567 234217699 53693224 853405827 538248861 841660562 239847518 347254527 81719421 326831893 336594724 242183...

result:

ok single line: '276564833 747181428 245358434 ... 105378754 437440589 546992718 '

Test #8:

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

input:

11 19 7 2
7 2 28748732
7 6 797829355
9 2 160449218
3 8 378994618
6 1 138996221
8 3 840594328
7 5 818008580
1 8 954291757
2 1 556259670
7 10 290688600
4 9 706926230
5 9 164163676
1 4 782177068
11 6 789301711
11 3 389872647
3 5 69356287
3 4 743988075
8 10 155374934
7 11 404011431

output:

28748732 

result:

ok single line: '28748732 '

Test #9:

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

input:

9 15 1 6
6 7 462224593
2 3 743144908
7 6 789301711
3 8 384836991
8 1 290688600
4 8 378994618
7 5 576823355
1 9 839296263
6 4 902236202
5 2 191890310
1 6 492601449
4 3 125660016
7 9 28748732
9 2 69356287
2 4 650287940

output:

492601449 

result:

ok single line: '492601449 '

Test #10:

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

input:

100 157 54 89
89 73 293931814
63 14 209896431
5 30 191699654
66 70 392042756
96 61 941158190
99 58 444754263
27 55 71758606
19 15 731546581
88 5 700175183
99 2 179330504
51 77 35043830
6 31 116721425
77 39 948580482
16 36 226667776
61 89 131822429
12 26 476717409
4 46 885401404
66 72 861769143
12 3 ...

output:

TOO LONG

result:

ok single line: 'TOO LONG'

Test #11:

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

input:

100 157 16 14
59 29 163840668
41 35 648002202
88 37 126484862
39 90 780916575
60 53 61164523
54 25 922434669
67 94 303668358
51 74 351045720
89 34 493183208
76 93 203312810
14 54 1847679
61 34 619782776
43 33 925789638
37 63 35291187
60 56 465863799
8 26 830369370
36 96 71285293
34 27 510401935
40 3...

output:

35043830 748071459 24317015 157390034 493183208 510401935 254961810 339729821 479242650 25948429 883836319 433768447 545560104 303668358 417219069 578686766 739981933 591982401 362175448 

result:

ok single line: '35043830 748071459 24317015 15... 739981933 591982401 362175448 '

Test #12:

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

input:

100 157 16 92
59 29 163840668
41 35 648002202
88 37 126484862
39 90 780916575
60 53 61164523
54 25 922434669
67 94 303668358
51 74 351045720
89 34 493183208
76 93 203312810
14 54 1847679
61 34 619782776
43 33 925789638
37 63 35291187
60 56 465863799
8 26 830369370
36 96 71285293
34 27 510401935
40 3...

output:

35043830 748071459 24317015 157390034 493183208 510401935 254961810 339729821 479242650 25948429 883836319 433768447 545560104 303668358 417219069 578686766 739981933 591982401 362175448 1847679 956589227 553404417 796835308 101957901 199599833 636836044 189562212 235201601 893560314 351045720 67839...

result:

ok single line: '35043830 748071459 24317015 15... 126484862 596033393 343179224 '

Test #13:

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

input:

100 387 70 42
96 23 883900370
46 100 291665505
32 5 549582798
37 69 835270251
52 12 933544909
93 76 825342136
64 65 599793848
87 98 208143309
30 32 383044581
31 17 841508779
100 65 824740741
100 85 617220431
30 36 811058646
7 16 712383395
80 68 388038394
82 28 11872932
1 95 952695414
47 40 159975200...

output:

349959309 389151686 15576349 41057275 124545298 106659436 189083002 827773447 444785755 39940010 199690805 530419963 299468062 565214022 145095625 122980613 845035969 155681311 604044394 251482858 789106114 471608076 862151588 74293636 506263448 102486552 375847675 377879657 373949193 813575077 1800...

result:

ok single line: '349959309 389151686 15576349 4...7 451120346 145936921 33040489 '

Test #14:

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

input:

100 387 70 29
96 23 883900370
46 100 291665505
32 5 549582798
37 69 835270251
52 12 933544909
93 76 825342136
64 65 599793848
87 98 208143309
30 32 383044581
31 17 841508779
100 65 824740741
100 85 617220431
30 36 811058646
7 16 712383395
80 68 388038394
82 28 11872932
1 95 952695414
47 40 159975200...

output:

349959309 389151686 15576349 41057275 124545298 106659436 189083002 827773447 444785755 39940010 199690805 530419963 299468062 565214022 145095625 122980613 845035969 155681311 604044394 251482858 789106114 471608076 862151588 74293636 506263448 102486552 375847675 377879657 373949193 813575077 1800...

result:

ok single line: '349959309 389151686 15576349 4...5 296827892 575845434 20951359 '

Test #15:

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

input:

700 243150 64 580
589 94 181785684
677 249 888141670
535 137 821063194
411 676 699609298
356 70 858634249
324 44 223317388
558 1 534222120
195 295 102444539
2 601 557245517
77 565 234108761
649 585 250532879
85 112 105729936
309 10 696899807
79 538 237627335
544 597 226807387
277 530 546878834
147 3...

output:

58257 804804 1343433 2750598 100952 6468543 3335307 1108923 1822228 838487 5168935 8045859 417456 1485598 411791 1043846 1525829 2748029 3533683 1278241 4228887 2570663 2950829 43123 3419400 1136765 3059035 3739850 2039825 1142213 7880313 1576850 9539348 2706787 3555086 390966 3110339 4320227 329216...

result:

ok single line: '58257 804804 1343433 2750598 1...6075010 475246 1640414 8500028 '

Test #16:

score: 0
Accepted
time: 21ms
memory: 14312kb

input:

700 243150 201 299
298 674 860646493
215 451 423248740
618 605 865867908
690 554 250363148
454 335 88561164
431 596 127725909
381 53 743625935
549 651 871860813
105 657 106220939
227 289 382995206
133 422 755116100
509 504 905981363
677 221 549408270
624 265 271525924
22 158 630115106
473 161 350238...

output:

58257 804804 1343433 2750598 100952 6468543 3335307 1108923 1822228 838487 5168935 8045859 417456 1485598 411791 1043846 1525829 2748029 3533683 1278241 4228887 2570663 2950829 43123 3419400 1136765 3059035 3739850 2039825 1142213 7880313 1576850 9539348 2706787 3555086 390966 3110339 4320227 329216...

result:

ok single line: '58257 804804 1343433 2750598 1...6075010 475246 1640414 8500028 '

Test #17:

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

input:

700 243150 201 299
298 674 860646493
215 451 423248740
618 605 865867908
690 554 250363148
454 335 88561164
431 596 127725909
381 53 743625935
549 651 871860813
105 657 106220939
227 289 382995206
133 422 755116100
509 504 905981363
677 221 549408270
624 265 271525924
22 158 630115106
473 161 350238...

output:

58257 804804 1343433 2750598 100952 6468543 3335307 1108923 1822228 838487 5168935 8045859 417456 1485598 411791 1043846 1525829 2748029 3533683 1278241 4228887 2570663 2950829 43123 3419400 1136765 3059035 3739850 2039825 1142213 7880313 1576850 9539348 2706787 3555086 390966 3110339 4320227 329216...

result:

ok single line: '58257 804804 1343433 2750598 1...6075010 475246 1640414 8500028 '

Test #18:

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

input:

700 243149 448 473
381 419 623014904
447 490 443081584
614 125 666564756
342 146 224116145
612 80 158718523
6 86 71769019
671 112 187983952
250 215 459075520
11 279 953185598
121 332 170496476
478 524 214111422
100 270 803708657
286 135 648638903
285 49 730737992
225 388 995110427
70 558 808552530
4...

output:

100952 6468543 3801046 5494034 1822228 3334210 5168935 9650469 417456 1819123 3742870 1043846 1525829 2966092 5159500 3827734 4228887 7509339 2950829 43123 3419400 2038404 3059035 3739850 8468194 1142213 8037028 5219573 2696497 4211037 3555086 2021556 3110339 5937978 329216 4049 9664711 9283191 1562...

result:

ok single line: '100952 6468543 3801046 5494034...1169105 2911167 2256081 802088 '

Test #19:

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

input:

700 243049 642 243
439 506 865550490
536 117 630308503
49 472 478102675
368 639 769850059
77 453 199976029
146 614 698398318
577 312 365553645
375 77 561208404
520 122 755775908
155 479 978061428
483 203 422954569
645 34 998320049
575 42 623841857
209 83 569840321
533 209 168913435
488 682 761465905...

output:

TOO LONG

result:

ok single line: 'TOO LONG'

Test #20:

score: 0
Accepted
time: 28ms
memory: 12404kb

input:

700 243156 424 593
560 353 89212441
470 461 992443540
644 412 790221005
651 624 869958149
54 160 389766862
128 92 941720636
633 340 879322315
427 202 730827362
248 579 112653186
329 298 849410893
403 119 297175173
403 476 902875334
426 371 861348482
668 504 169945565
589 623 518770923
650 140 579101...

output:

995739009 995095228 997860656 994442847 

result:

ok single line: '995739009 995095228 997860656 994442847 '

Test #21:

score: 0
Accepted
time: 24ms
memory: 12472kb

input:

700 243156 424 660
560 353 89212441
470 461 992443540
644 412 790221005
651 624 869958149
54 160 389766862
128 92 941720636
633 340 879322315
427 202 730827362
248 579 112653186
329 298 849410893
403 119 297175173
403 476 902875334
426 371 861348482
668 504 169945565
589 623 518770923
650 140 579101...

output:

995739009 995095228 997860656 994442847 991906013 

result:

ok single line: '995739009 995095228 997860656 994442847 991906013 '

Test #22:

score: 0
Accepted
time: 29ms
memory: 14564kb

input:

700 243156 424 454
560 353 89212441
470 461 992443540
644 412 790221005
651 624 869958149
54 160 389766862
128 92 941720636
633 340 879322315
427 202 730827362
248 579 112653186
329 298 849410893
403 119 297175173
403 476 902875334
426 371 861348482
668 504 169945565
589 623 518770923
650 140 579101...

output:

995739009 995095228 

result:

ok single line: '995739009 995095228 '

Test #23:

score: 0
Accepted
time: 22ms
memory: 23796kb

input:

700 242156 647 441
494 179 984640856
49 200 44730812
693 185 894086266
329 242 883974048
317 513 768098864
314 532 646203439
692 332 386097236
640 610 476052402
354 325 115591830
499 610 421055545
215 296 16235097
466 251 446476261
128 394 576868150
371 163 671014536
468 63 724683861
41 374 40052318...

output:

TOO LONG

result:

ok single line: 'TOO LONG'

Test #24:

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

input:

700 244649 527 181
92 80 784371701
665 271 973916384
484 383 833826089
226 71 800387668
99 397 75662832
68 280 828021753
330 464 884071567
310 413 278665234
81 477 125333859
224 208 44586864
416 75 181599102
673 362 799491882
252 579 819362850
168 645 234160421
477 318 917919744
295 356 739751557
56...

output:

2748029 6775106 1278241 4228887 2570663 2950829 43123 3419400 1136765 3059035 3739850 2039825 1142213 1576850 2696497 2706787 10303368 3555086 390966 3110339 329216 4049 11422641 4861039 2375848 156239 3003609 470327 3064615 939136 506790 1251625 829771 7389382 1458623 659405 2429709 1104137 928756 ...

result:

ok single line: '2748029 6775106 1278241 422888...6179105 711212 390575 16527722 '

Test #25:

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

input:

100000 100000 64268 47678
75936 92853 949383173
22354 47522 217427650
84144 17877 201110679
69083 76588 26178535
93694 56793 434733925
30814 89200 404739625
8122 73222 108893019
56186 85746 397875435
67907 84225 179106683
46847 96952 970754290
55038 26927 784257506
88077 60436 310647519
49638 54647 ...

output:

515440601 317564478 187177831 495444334 424752466 975961690 717660208 202710754 996285990 143711122 596830637 504993795 714269337 897042817 563814743 341404653 84482678 232859365 325956712 166551841 571397000 834584607 59105887 294743554 370720802 99184055 934060415 411191641 556947864 492426966 611...

result:

ok single line: '515440601 317564478 187177831 ... 544983258 660803791 611009357 '

Test #26:

score: 0
Accepted
time: 125ms
memory: 23352kb

input:

100000 300000 2817 17829
3316 98733 621542674
51323 65113 27896356
97665 9706 658469839
60843 42490 72548476
36293 68143 956084327
42653 48334 120918437
46709 56251 985562568
49450 2183 829632193
25993 75141 517990668
41450 22087 243037681
86339 57461 814996521
66284 87636 167879851
96221 21357 9729...

output:

166637302 194713999 56610547 328314156 510411395 399985951 39632166 101795231 131263597 126654420 138613351 455477761 19049809 330092341 5251504 131934782 17122336 52064955 97935351 281592115 79065390 958090260 80763864 18677652 249213978 240914675 130282509 848813990 76446968 64557344 41611069 6385...

result:

ok single line: '166637302 194713999 56610547 3...0 198102233 319436150 53877084 '

Test #27:

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

input:

99997 299176 93379 90717
48328 15140 587043307
37535 15903 348900100
77163 73959 232771469
90936 39195 135990134
16605 754 90420640
87579 20255 651678606
46771 22592 561615430
59192 36870 477121578
94905 8625 332569635
81733 63548 39862672
33979 57456 60174043
40634 32181 417672828
51420 79147 15266...

output:

93426332 

result:

ok single line: '93426332 '

Test #28:

score: 0
Accepted
time: 106ms
memory: 22728kb

input:

99997 299176 93379 99165
48328 15140 587043307
37535 15903 348900100
77163 73959 232771469
90936 39195 135990134
16605 754 90420640
87579 20255 651678606
46771 22592 561615430
59192 36870 477121578
94905 8625 332569635
81733 63548 39862672
33979 57456 60174043
40634 32181 417672828
51420 79147 15266...

output:

93426332 185093989 

result:

ok single line: '93426332 185093989 '

Test #29:

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

input:

99997 299177 66852 89357
48608 80671 673432051
52172 64028 351594412
21059 84759 777320867
6531 22534 237579479
81136 71301 961781059
28019 68052 656431593
11893 61088 307431265
24465 61006 263707202
67517 65728 586608689
49780 57409 420640815
8290 45546 775209921
80134 47488 279985899
16428 85896 2...

output:

285835617 

result:

ok single line: '285835617 '

Test #30:

score: 0
Accepted
time: 111ms
memory: 22736kb

input:

99997 299177 66852 69837
48608 80671 673432051
52172 64028 351594412
21059 84759 777320867
6531 22534 237579479
81136 71301 961781059
28019 68052 656431593
11893 61088 307431265
24465 61006 263707202
67517 65728 586608689
49780 57409 420640815
8290 45546 775209921
80134 47488 279985899
16428 85896 2...

output:

285835617 93426332 

result:

ok single line: '285835617 93426332 '

Test #31:

score: 0
Accepted
time: 124ms
memory: 23220kb

input:

99997 299177 66852 21692
48608 80671 673432051
52172 64028 351594412
21059 84759 777320867
6531 22534 237579479
81136 71301 961781059
28019 68052 656431593
11893 61088 307431265
24465 61006 263707202
67517 65728 586608689
49780 57409 420640815
8290 45546 775209921
80134 47488 279985899
16428 85896 2...

output:

285835617 93426332 185093989 191966981 527967466 110087401 112062717 187626692 820958975 156603335 665343509 214646132 382140821 364704219 481110234 359623461 508627672 104541986 515248127 110354560 900157762 893295186 140200836 240643415 99379371 285039612 24927459 553075450 294279300 99613882 5698...

result:

ok single line: '285835617 93426332 185093989 1...486 414340 187734611 343984632 '

Test #32:

score: 0
Accepted
time: 219ms
memory: 31120kb

input:

99997 279177 66852 21692
55626 68802 6897758
92864 54369 43149162
9273 97294 879345298
14603 52050 3017480
31400 78984 238518714
6790 57567 945692767
46901 91117 86130110
14623 86191 221521323
26741 56593 229826446
80456 13272 757213758
40594 33531 233738969
94880 62700 349353445
53707 52097 8764564...

output:

TOO LONG

result:

ok single line: 'TOO LONG'

Test #33:

score: 0
Accepted
time: 71ms
memory: 19712kb

input:

99997 238439 76110 94862
67336 41680 95457619
62570 39286 630213211
99721 54957 90893155
32990 39381 429764919
39267 23985 785569508
56413 24942 527614726
16047 37440 487527680
93694 20888 675302709
80888 98460 897076346
86800 67293 912385615
55897 30024 171043783
95765 89080 520226050
62283 60815 2...

output:

791392824 862991398 2922244 716456576 649279012 923764800 627394151 964816035 701583699 750750924 828005179 48683517 83430188 906443971 437241440 199253671 983615762 664219065 744538882 972914680 334861359 462960831 19537247 805764843 193018787 86616576 946331818 498230632 846763410 276353681 914984...

result:

ok single line: '791392824 862991398 2922244 71... 538907671 616391060 752599998 '

Test #34:

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

input:

99997 238439 76110 28597
67336 41680 95457619
62570 39286 630213211
99721 54957 90893155
32990 39381 429764919
39267 23985 785569508
56413 24942 527614726
16047 37440 487527680
93694 20888 675302709
80888 98460 897076346
86800 67293 912385615
55897 30024 171043783
95765 89080 520226050
62283 60815 2...

output:

791392824 862991398 2922244 716456576 649279012 923764800 627394151 964816035 701583699 750750924 828005179 48683517 83430188 906443971 437241440 199253671 983615762 664219065 744538882 972914680 334861359 462960831 19537247 805764843 193018787 86616576 946331818 498230632 846763410 276353681 914984...

result:

ok single line: '791392824 862991398 2922244 71... 616391060 752599998 822642871 '

Test #35:

score: 0
Accepted
time: 72ms
memory: 19632kb

input:

99997 238439 76110 2020
67336 41680 95457619
62570 39286 630213211
99721 54957 90893155
32990 39381 429764919
39267 23985 785569508
56413 24942 527614726
16047 37440 487527680
93694 20888 675302709
80888 98460 897076346
86800 67293 912385615
55897 30024 171043783
95765 89080 520226050
62283 60815 21...

output:

791392824 862991398 2922244 716456576 649279012 923764800 627394151 964816035 701583699 750750924 828005179 48683517 83430188 906443971 437241440 199253671 983615762 664219065 744538882 972914680 334861359 462960831 19537247 805764843 193018787 86616576 946331818 498230632 846763410 276353681 914984...

result:

ok single line: '791392824 862991398 2922244 71... 752599998 822642871 541518222 '

Test #36:

score: 0
Accepted
time: 13ms
memory: 10740kb

input:

99997 38436 64268 9758
92024 23589 803259032
76411 65909 15701814
51235 55345 883081403
83649 16253 621910594
53896 54119 150125091
98319 49363 928461881
11710 33119 268517541
64973 73501 989782246
57612 80151 888627707
27973 33485 559182144
53426 32663 968332726
20223 40069 820134687
38118 994 9452...

output:

581388083 71270375 

result:

ok single line: '581388083 71270375 '

Test #37:

score: 0
Accepted
time: 78ms
memory: 19644kb

input:

99997 238439 76110 63099
67336 41680 95457619
62570 39286 630213211
99721 54957 90893155
32990 39381 429764919
39267 23985 785569508
56413 24942 527614726
16047 37440 487527680
93694 20888 675302709
80888 98460 897076346
86800 67293 912385615
55897 30024 171043783
95765 89080 520226050
62283 60815 2...

output:

791392824 862991398 2922244 716456576 649279012 923764800 627394151 964816035 701583699 750750924 828005179 48683517 83430188 906443971 437241440 199253671 983615762 664219065 744538882 972914680 334861359 462960831 19537247 805764843 193018787 86616576 946331818 498230632 846763410 276353681 914984...

result:

ok single line: '791392824 862991398 2922244 71... 969794002 952332760 412970412 '

Test #38:

score: 0
Accepted
time: 59ms
memory: 19040kb

input:

99997 221267 82012 55918
40464 67128 683499895
9080 1581 385876835
86856 97088 168257596
33901 89072 957937896
65441 12498 828951733
78304 37466 415502367
97822 30733 510848600
19951 45304 640469658
77032 75099 885282186
47876 86084 459197216
97341 52837 763795955
94337 51538 291721212
22167 33026 1...

output:

693020011 630060194 128940950 305040846 615987390 849223939 676950162 868420197 842075747 249126258 909015325 509539167 637554941 730813438 852623277 287680663 915702027 858579761 630622417 955822222 71292000 116514890 111896380 812796493 414982422 264896204 261873679 549469370 540423125 442400496 8...

result:

ok single line: '693020011 630060194 128940950 ... 694921374 623311161 828506165 '

Test #39:

score: 0
Accepted
time: 105ms
memory: 22116kb

input:

99997 278439 14927 44993
11777 5257 993971567
90756 9362 189401090
52659 82805 866434190
4909 21823 427180872
28578 45587 637831743
97024 54879 952333217
24054 46661 705296524
65684 33867 293683934
18720 33710 69276107
75817 13522 506589858
2717 56138 167596965
38182 29396 837956117
51101 90590 3581...

output:

7743720 476051872 26637941 234058604 438628507 219160491 237788393 395326131 43277853 784824965 702557525 215806455 309044724 607100755 303150849 14790882 964885018 221373863 193451670 269857756 461692186 856872733 618937171 22009722 281712856 40173458 373632140 414860393 494835578 92006031 58351675...

result:

ok single line: '7743720 476051872 26637941 234...82 169420984 417566643 5466738 '

Test #40:

score: 0
Accepted
time: 135ms
memory: 30684kb

input:

99997 278439 2094 90716
78960 72569 964912324
91642 48978 29178132
57644 36767 960427366
33060 27896 541127437
49547 26683 16663412
83852 14905 131428803
14494 27035 981202345
5872 47159 556754607
25059 38643 779763760
15794 68844 429414920
74651 77605 816445646
58736 85392 240953374
32922 49379 532...

output:

TOO LONG

result:

ok single line: 'TOO LONG'

Test #41:

score: 0
Accepted
time: 88ms
memory: 23352kb

input:

100000 299999 8885 53321
99585 35264 454174952
11172 59937 476508053
56711 38940 946371325
99761 99180 506012965
1803 96170 442898557
26417 48281 525632860
33115 47573 618478424
91199 22866 74647853
60411 86371 370289885
91105 98557 444722737
61700 63831 123123796
11265 11903 954357438
4768 74801 65...

output:

390700402 166637302 56610547 360564346 328314156 510411395 399985951 39632166 387112584 126654420 306507629 138613351 50733828 377735956 5251504 68419556 17122336 118956084 52064955 281592115 79065390 190161504 90756485 18677652 470193694 249213978 240914675 130282509 76446968 467223152 64557344 416...

result:

ok single line: '390700402 166637302 56610547 3...0 50284754 231263353 329767280 '

Test #42:

score: 0
Accepted
time: 84ms
memory: 23352kb

input:

100000 299999 8885 87852
99585 35264 454174952
11172 59937 476508053
56711 38940 946371325
99761 99180 506012965
1803 96170 442898557
26417 48281 525632860
33115 47573 618478424
91199 22866 74647853
60411 86371 370289885
91105 98557 444722737
61700 63831 123123796
11265 11903 954357438
4768 74801 65...

output:

390700402 166637302 56610547 360564346 328314156 510411395 399985951 39632166 387112584 126654420 306507629 138613351 50733828 377735956 5251504 68419556 17122336 118956084 52064955 281592115 79065390 190161504 90756485 18677652 470193694 249213978 240914675 130282509 76446968 467223152 64557344 416...

result:

ok single line: '390700402 166637302 56610547 3...5 508303787 569361023 62028751 '

Test #43:

score: 0
Accepted
time: 80ms
memory: 23244kb

input:

100000 299219 19979 58533
21267 90280 599733056
20253 72731 268312565
92484 73827 388303500
84578 27643 775074127
57075 86835 58697620
37908 56539 57591959
30920 66287 247420030
65943 87388 544593531
50505 22643 989332327
46613 41968 539530189
19051 66876 594442251
47216 33068 406909426
50511 52675 ...

output:

131949422 85100909 80856037 222360673 441095959 943419452 184837580 320721049 169071893 388500783 232592982 113220917 34194802 823388741 617472213 375984684 202271349 735097269 129534889 14786342 340367878 103854261 139488922 26831335 458561208 151751927 277411256 603632311 121855824 21765697 155767...

result:

ok single line: '131949422 85100909 80856037 22... 265500640 302408294 750629031 '

Test #44:

score: 0
Accepted
time: 41ms
memory: 17504kb

input:

100000 99218 64268 30064
48955 87888 565222201
18595 39188 967538923
87891 26789 653097384
18460 88076 784053832
2525 34466 932103860
70417 68518 914279015
44300 93551 750042330
4118 48387 332807684
98670 98704 668966190
7999 13154 904581319
5302 47018 827570978
23722 97890 608754233
80767 19919 912...

output:

515440601 317564478 187177831 495444334 424752466 975961690 717660208 202710754 996285990 143711122 596830637 504993795 714269337 897042817 563814743 341404653 84482678 232859365 325956712 166551841 571397000 834584607 59105887 294743554 370720802 99184055 934060415 411191641 556947864 492426966 611...

result:

ok single line: '515440601 317564478 187177831 ... 920318463 394898197 432313242 '

Test #45:

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

input:

100000 99218 64268 39717
48955 87888 565222201
18595 39188 967538923
87891 26789 653097384
18460 88076 784053832
2525 34466 932103860
70417 68518 914279015
44300 93551 750042330
4118 48387 332807684
98670 98704 668966190
7999 13154 904581319
5302 47018 827570978
23722 97890 608754233
80767 19919 912...

output:

515440601 317564478 187177831 495444334 424752466 975961690 717660208 202710754 996285990 143711122 596830637 504993795 714269337 897042817 563814743 341404653 84482678 232859365 325956712 166551841 571397000 834584607 59105887 294743554 370720802 99184055 934060415 411191641 556947864 492426966 611...

result:

ok single line: '515440601 317564478 187177831 ... 432313242 387654943 611810177 '

Test #46:

score: 0
Accepted
time: 102ms
memory: 23268kb

input:

100000 299918 88061 96071
41398 32757 964915138
84465 2066 632231800
21226 52269 869418813
94475 65538 221322702
80157 85784 283596547
20841 81363 613108630
52373 50181 333314622
41342 11539 672017864
64892 63320 878478233
10901 81506 355460493
35728 64914 323034686
35701 4985 206183759
99827 33261 ...

output:

643791589 213700947 226767753 383034540 562557936 520690631 15297372 205594744 378818930 546065609 5163433 20996679 91654028 991638678 345111166 568469462 246193094 909546008 205797474 280133879 359317409 324595116 484569938 301291454 473954367 407769469 319775971 66342247 51790361 290021044 1637179...

result:

ok single line: '643791589 213700947 226767753 ...87 191449829 23669689 48521987 '

Test #47:

score: 0
Accepted
time: 87ms
memory: 21040kb

input:

100000 299918 2817 47894
18295 3965 86955356
60128 82537 876600264
36400 64924 126716452
10460 74048 530652187
19777 87427 330914712
20310 17843 734612878
52312 55374 684621877
41880 98555 934369487
35935 8970 490897373
34238 1896 606232191
19523 31816 786829588
96693 63587 327986023
62673 84075 952...

output:

IMPOSSIBLE

result:

ok single line: 'IMPOSSIBLE'

Test #48:

score: 0
Accepted
time: 175ms
memory: 31516kb

input:

100000 290000 79303 87790
23289 92262 552605605
36658 34870 518462670
75317 80144 63763134
57734 42665 947188452
41007 61234 509996304
40209 10839 898340897
48019 3403 93828921
15848 30884 32863130
78853 71848 720969443
20969 92998 976470167
30538 3200 705878590
196 45304 640437508
70500 27876 30169...

output:

TOO LONG

result:

ok single line: 'TOO LONG'

Test #49:

score: 0
Accepted
time: 172ms
memory: 30708kb

input:

100000 299998 79303 87790
6379 76905 665938795
27660 73630 235140247
16118 73951 680852225
28181 1102 19859862
38920 50452 38073458
42193 94185 479866395
63532 79253 194308848
43247 16992 656395118
71 60113 747805998
5397 59641 280133756
31850 14410 63946601
96968 30760 703408732
6442 30979 53150640...

output:

TOO LONG

result:

ok single line: 'TOO LONG'

Test #50:

score: -100
Time Limit Exceeded

input:

100000 200508 12683 37055
17776 64324 989357784
42582 92225 275341537
31571 88091 933919181
89910 58325 123872768
42132 45698 482146877
112 14558 727378400
86200 78532 110150880
17776 1373 926333142
42132 45810 264427085
19923 11433 672067611
86200 26950 30771985
42132 25948 573431025
19923 8230 884...

output:


result: