QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#62334#22. Power plantsDec0Dedd100 ✓1019ms25120kbC++142.7kb2022-11-18 06:43:352022-11-18 06:43:37

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 10
Accepted

Test #1:

score: 10
Accepted
time: 5ms
memory: 6388kb

input:

100
387 501
90 108
273 76
754 365
121 556
102 401
831 215
841 829
424 690
17 35
10 980
34 917
948 478
766 818
55 588
510 772
16 511
499 323
632 554
461 454
281 247
720 575
994 720
739 30
989 992
507 557
665 621
356 398
161 822
906 556
189 835
208 500
628 829
402 969
804 155
697 581
107 630
102 568
3...

output:

425
6
75 84 66 49 35 7 
94
11 99 17 10 12 77 15 59 2 6 38 82 37 86 51 41 5 87 90 29 55 31 44 73 32 45 3 21 96 64 63 42 53 56 70 39 92 28 98 1 54 34 9 100 20 48 88 78 83 18 26 16 43 91 52 93 79 65 80 71 33 19 27 62 89 36 85 22 94 24 4 14 50 40 69 46 81 97 47 8 76 57 68 74 72 95 58 30 60 13 61 25 67 23 

result:

ok 

Test #2:

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

input:

95
298 129
485 422
97 190
732 393
73 529
920 101
94 150
806 369
223 653
572 820
985 456
109 602
329 669
670 742
9 999
410 14
854 791
450 635
223 973
14 923
626 891
367 443
226 524
899 949
558 195
556 825
775 987
976 264
32 627
776 194
986 118
427 216
816 477
538 159
674 325
516 388
519 250
10 850
30...

output:

1530
13
65 48 19 70 40 43 88 42 10 30 72 28 11 
82
15 38 73 20 29 77 5 7 3 12 56 71 51 44 91 9 23 45 84 1 39 53 82 87 13 22 80 16 85 67 32 62 18 93 47 2 54 50 36 37 34 26 25 95 76 68 79 63 57 21 92 14 35 89 58 78 60 52 69 4 81 90 27 74 86 94 83 8 66 33 61 17 24 41 6 75 55 46 64 49 31 59 

result:

ok 

Test #3:

score: 0
Accepted
time: 7ms
memory: 6388kb

input:

97
45 2
63 84
71 62
15 8
23 74
33 30
87 92
50 25
55 44
36 69
36 20
58 61
19 72
28 33
96 72
93 14
98 62
85 62
4 33
55 54
86 91
86 60
82 27
46 39
16 61
85 37
11 74
11 48
97 96
9 71
46 14
6 70
37 32
17 93
39 98
27 22
79 44
86 1
55 15
66 19
41 97
71 61
83 23
87 62
13 48
72 56
47 68
45 82
10 88
96 96
71 ...

output:

5
9
45 82 42 94 72 7 44 15 29 
88
65 62 79 19 32 30 49 28 27 58 92 4 87 25 34 13 75 73 61 84 5 53 36 91 85 14 6 88 10 11 56 33 35 41 97 71 52 59 1 48 31 24 54 47 55 67 8 39 20 9 95 81 12 60 96 76 2 69 40 66 78 3 51 68 46 90 83 57 63 37 70 23 93 43 74 18 89 26 21 22 38 77 64 16 80 50 86 17 

result:

ok 

Test #4:

score: 0
Accepted
time: 7ms
memory: 6440kb

input:

95
292 500
313 500
687 500
500 480
791 500
500 916
875 500
438 500
583 500
645 500
500 979
500 520
916 500
937 500
500 604
500 500
500 812
500 625
500 105
500 791
500 937
146 500
417 500
500 334
396 500
42 500
459 500
500 770
355 500
500 854
500 645
500 313
500 271
500 146
334 500
958 500
501 501
50...

output:

8
1
16 
94
48 26 56 67 89 79 22 86 87 46 77 83 88 1 2 35 29 70 25 23 8 27 40 84 59 66 65 61 60 74 58 57 11 54 53 52 68 72 17 75 76 78 80 82 85 6 4 92 93 38 24 15 21 28 30 31 32 33 34 20 19 43 50 49 12 47 18 44 42 41 37 69 62 39 9 94 63 10 73 3 51 91 45 81 5 90 95 55 7 64 13 14 36 71 

result:

ok 

Test #5:

score: 0
Accepted
time: 11ms
memory: 6396kb

input:

99
815 111
6 579
250 933
336 972
555 3
12 389
990 405
55 270
790 907
6 420
106 190
460 998
492 0
71 756
617 985
995 563
586 992
197 102
397 989
839 867
678 32
736 59
920 229
30 328
964 685
149 143
975 343
648 22
88 783
902 203
127 833
964 314
41 299
249 66
30 671
428 5
0 515
586 7
366 981
995 436
49...

output:

1066
49
37 51 2 6 96 24 56 8 14 43 91 93 42 50 55 48 3 70 97 73 39 82 44 69 41 63 95 38 15 28 57 60 88 61 9 1 20 64 94 30 86 52 32 25 76 46 40 16 87 
50
67 89 10 54 92 35 33 78 74 29 11 31 26 90 18 65 34 83 81 4 98 19 36 12 13 58 5 17 80 45 21 84 22 68 75 99 72 53 59 77 23 49 66 71 27 79 47 7 85 62 

result:

ok 

Test #6:

score: 0
Accepted
time: 7ms
memory: 6396kb

input:

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

output:

2
41
3 6 74 40 67 34 35 1 60 55 53 62 69 72 44 45 49 26 20 17 43 78 30 61 52 33 25 47 56 5 15 80 32 81 14 48 65 63 57 75 29 
40
2 77 28 27 38 24 23 7 66 50 31 4 8 41 54 9 13 18 59 71 64 12 68 10 19 46 21 16 36 70 37 11 73 76 58 39 51 22 42 79 

result:

ok 

Test #7:

score: 0
Accepted
time: 10ms
memory: 6276kb

input:

100
845 825
422 32
580 328
94 955
607 941
991 977
94 217
986 857
983 777
296 306
439 746
578 46
884 259
475 542
577 48
215 341
148 73
709 71
194 747
794 685
718 657
76 756
802 901
982 583
618 954
252 117
609 943
371 279
90 222
496 958
840 823
879 260
45 245
173 603
662 740
795 627
373 276
419 35
415...

output:

281
50
33 22 7 93 85 55 34 40 63 16 95 75 54 10 53 61 37 81 79 2 76 41 66 45 62 30 12 3 43 27 74 68 92 18 83 58 64 20 97 59 77 1 94 80 13 46 24 99 8 98 
50
73 86 29 4 17 72 60 87 19 56 26 57 84 50 71 44 28 69 39 38 65 11 51 70 14 78 15 89 52 5 25 88 35 82 21 42 67 91 36 23 47 31 90 32 48 96 49 9 100...

result:

ok 

Test #8:

score: 0
Accepted
time: 10ms
memory: 6288kb

input:

100
351 159
387 82
565 234
715 966
38 208
991 866
200 21
574 529
543 319
216 543
374 653
825 704
591 437
936 295
284 478
785 380
609 454
283 155
790 95
220 181
751 869
877 960
744 61
111 780
583 203
696 211
37 868
930 773
298 129
137 483
952 658
492 154
563 958
935 11
263 844
209 378
9 636
536 878
5...

output:

853
10
68 70 25 79 13 77 42 12 100 91 
90
37 52 78 27 5 50 75 87 76 24 98 30 41 81 7 58 36 10 20 44 96 85 35 18 15 48 71 29 54 62 1 80 63 11 45 2 94 97 46 90 32 57 39 38 9 60 56 33 3 8 88 93 65 17 66 99 86 26 4 61 49 95 74 47 23 21 40 51 16 19 84 67 83 53 89 69 22 72 64 92 59 55 28 34 14 31 43 73 6 ...

result:

ok 

Test #9:

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

input:

100
464 814
173 646
422 812
632 761
136 559
443 813
740 617
834 171
281 760
544 802
750 500
230 718
135 364
759 119
143 340
219 205
507 62
186 665
401 808
563 797
397 85
340 791
727 650
706 93
144 582
484 813
151 316
130 535
371 94
125 413
748 583
277 150
423 76
130 389
124 487
451 70
381 804
785 13...

output:

800
39
60 35 28 34 15 25 53 61 18 93 75 16 83 40 9 85 66 64 81 21 19 6 79 26 52 92 89 20 46 90 4 54 97 84 23 7 31 56 63 
61
86 30 74 13 5 27 39 2 100 72 87 12 71 68 32 62 95 22 29 37 3 33 36 1 51 58 17 44 10 98 96 99 48 88 73 91 80 49 24 77 45 59 78 11 65 76 14 38 50 8 94 70 42 47 43 69 55 57 41 67 ...

result:

ok 

Subtask #2:

score: 25
Accepted

Dependency #1:

100%
Accepted

Test #10:

score: 25
Accepted
time: 15ms
memory: 6728kb

input:

2000
6656 36013
17956 38816
27582 2843
35098 36562
37326 25620
9311 12897
28300 8999
12801 12172
23738 23210
14428 6352
15922 13965
12936 32581
34742 14350
37329 23294
14140 35598
13133 19875
37742 36602
14322 6642
22080 14603
8989 7439
3353 31999
2980 18775
18422 1027
37749 20652
21614 27031
7197 2...

output:

6560
26
1133 302 75 413 984 1172 1818 1916 1369 960 1398 1993 259 925 1949 1207 323 854 1918 1026 1792 1069 197 909 1697 1095 
1974
770 1672 1362 144 1118 236 1803 979 1203 1448 1610 490 648 252 1507 1794 1016 804 492 1585 624 683 1971 642 1606 1460 485 1977 352 557 1863 1117 342 1905 1714 810 1676 ...

result:

ok 

Test #11:

score: 0
Accepted
time: 17ms
memory: 6616kb

input:

1814
21174 38708
32970 28661
27373 4800
28065 4522
32688 8747
16399 31278
24005 34303
33873 36750
15967 33261
4040 6842
7951 5550
31481 17924
39704 19328
35729 4162
36435 18728
37840 31349
17148 3065
32106 9758
14081 29393
19461 1956
11679 38126
37305 10201
14570 2250
35591 13991
21671 29312
37253 1...

output:

15245
50
1140 477 767 1296 1213 178 987 814 532 1232 1679 1527 1120 737 1338 1086 194 1039 1129 587 1782 122 465 555 1504 88 618 1255 734 1149 1529 330 392 143 1282 147 751 173 1033 74 5 2 884 1727 926 26 424 1632 1569 1549 
1764
1655 45 1658 1765 865 1558 1389 1776 959 1502 474 1471 166 797 856 69 ...

result:

ok 

Test #12:

score: 0
Accepted
time: 16ms
memory: 6520kb

input:

1880
414 801
1765 607
1089 1518
773 100
32 1671
398 791
196 822
1435 432
713 206
931 842
1260 1585
1117 122
1606 642
885 1941
784 1996
1605 143
1337 1588
566 1858
363 1953
60 949
1618 1094
1360 1384
854 1750
486 844
380 1925
667 1216
1326 1369
1132 1418
1673 1659
121 1791
1985 41
947 130
1608 1774
1...

output:

29
35
227 951 1151 211 1823 915 640 1752 1143 446 319 395 1127 1271 72 67 1176 1541 648 104 744 1069 567 942 770 1507 1578 1064 226 883 1514 976 1730 957 1167 
1845
844 862 133 1510 1690 938 136 798 1716 1201 1065 368 1685 1809 781 919 121 905 474 219 1197 1499 154 1605 967 956 401 1530 5 1563 498 8...

result:

ok 

Test #13:

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

input:

1995
2045 20000
20000 21563
35430 20000
20000 38877
20000 7295
22885 20000
20000 11904
20000 30260
20000 22044
20000 16233
33787 20000
20000 25170
20000 31903
20000 8377
20000 31342
26012 20000
20000 34629
1123 20000
20000 34869
6453 20000
20000 19920
31462 20000
19159 20000
20000 10461
20000 33146
...

output:

8
1
1698 
1994
1431 1754 884 173 1745 405 918 926 427 1868 497 1358 151 813 980 386 854 1065 1286 886 1097 1302 1693 1603 615 900 1725 18 1660 744 1697 1793 57 1765 525 1760 1526 1410 61 1009 1129 930 1076 739 1440 764 1089 1694 817 1288 1 148 159 754 1817 1208 1654 640 1338 1700 280 576 1028 1015 3...

result:

ok 

Test #14:

score: 0
Accepted
time: 10ms
memory: 6856kb

input:

1999
3878 31836
39960 21256
178 17336
39849 22445
11239 2020
21178 39965
23114 244
19481 39993
3066 9358
39417 24793
26526 1094
36643 31090
10678 2304
17601 39855
9001 3295
36747 30932
32300 4229
10 19340
161 17460
38685 12868
39679 23564
39609 16065
38900 26540
6993 4806
27932 38359
22305 39866
717...

output:

4090
999
1538 1496 942 1804 770 147 1566 179 198 1041 18 44 1593 1998 1152 1991 340 565 612 987 1672 1308 1665 1050 1952 93 1598 1208 94 1228 402 1757 1122 1305 1681 1691 364 257 1179 851 19 494 3 528 97 1841 481 1432 350 1198 1749 1365 195 163 196 636 211 1121 237 928 240 549 719 1886 1397 1393 122...

result:

ok 

Test #15:

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

input:

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

output:

2
968
1096 268 632 1289 1086 73 1000 84 617 1592 719 783 1827 1917 753 1104 572 344 272 543 611 1547 68 1042 1377 1089 367 222 1620 114 839 1069 835 462 595 1915 1201 313 977 179 47 1605 292 1486 975 158 1057 1630 942 1026 1027 1766 535 1353 516 248 659 1849 786 793 221 291 1227 1929 95 1417 1222 16...

result:

ok 

Test #16:

score: 0
Accepted
time: 17ms
memory: 6544kb

input:

1992
306 37924
38427 27958
8926 12030
27489 19285
38238 27286
17983 28458
1840 9861
27552 19604
7504 2884
19349 7486
10529 27553
39910 4330
34843 7397
31545 17158
18246 39978
10455 9952
39712 39598
38441 17586
17009 5364
24267 14406
27962 16744
27974 1812
22883 4112
6181 7896
37926 6732
11091 11855
...

output:

2138
992
1533 977 1036 481 1797 1169 1933 469 605 552 318 1109 1200 633 502 356 500 1665 343 1080 895 683 1795 100 702 1496 1728 141 1777 288 1766 632 1494 903 660 255 1723 1852 589 752 337 729 1644 1952 1368 7 1332 1855 1099 1821 1820 1060 72 1513 1175 1567 822 805 304 587 882 1268 37 77 1896 267 7...

result:

ok 

Test #17:

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

input:

2000
12637 20722
5811 21567
4662 39644
21724 25871
37976 22166
826 24747
39424 26287
15649 15481
13915 10224
1760 19764
14564 8363
29536 20965
3060 6764
32254 39746
26796 14893
35927 16726
37424 20568
21330 28438
31371 9999
19700 11073
3353 6335
39896 37387
30042 25198
2113 18543
25941 27908
39240 3...

output:

15250
49
1299 215 1076 785 1263 596 1679 221 398 1338 1923 1753 1129 473 1634 1485 1355 1525 1489 816 1336 175 30 376 1130 191 953 189 1016 1083 1468 1916 1209 938 1930 1464 1548 674 154 551 1260 1894 1100 631 883 515 429 1752 1755 
1951
1640 1230 1773 1527 1678 1703 1417 1126 1104 1231 713 227 1595...

result:

ok 

Test #18:

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

input:

2000
29399 25371
29911 23644
39298 16123
8402 27923
25861 2952
38856 14769
15020 32137
26905 3245
24695 2704
27611 3482
24590 30943
18897 32589
4935 17683
39021 15235
27588 28414
5377 14701
5095 16092
18540 2695
13320 31541
5018 20164
27395 3406
30080 20635
16148 32394
14700 32044
28395 27324
30122 ...

output:

3925
987
1290 469 536 327 650 1175 43 386 1116 1120 581 1818 1428 1742 62 13 905 1346 209 497 838 1884 720 1977 727 1058 812 1686 394 1790 292 1219 316 949 1332 1762 20 940 1750 1328 1392 1616 1864 109 290 1549 323 1931 1482 1409 1684 658 590 347 452 1384 1019 417 33 731 1221 231 842 1226 932 145 65...

result:

ok 

Subtask #3:

score: 65
Accepted

Dependency #2:

100%
Accepted

Test #19:

score: 65
Accepted
time: 854ms
memory: 11424kb

input:

100000
86906317 677293372
296132899 233592282
855515093 484310886
896196452 379278033
585155823 182058640
256572667 337258782
77013095 617791578
298155474 617701948
203022896 120906904
700113795 817766366
10932305 828355830
601157685 66977660
84465578 493682621
37027543 713776658
323862182 770128858...

output:

29023118617
511
95738 5242 12535 9252 82016 24474 95883 95253 99598 25285 16780 14021 36076 12925 2996 60756 52505 2787 97551 82401 56891 8279 15251 16256 39659 56047 54324 42739 47919 67045 95595 21537 56864 11512 43886 97526 89161 46821 32058 2359 13129 56957 53519 16390 98225 77557 94491 79408 27...

result:

ok 

Test #20:

score: 0
Accepted
time: 757ms
memory: 11144kb

input:

91743
578366302 927433638
71023543 137807206
294318266 338014821
964689287 252905228
220392227 696876231
919459690 810526230
68400622 189922973
783715277 844662230
738992157 434157447
415674312 625021643
185627558 311456999
903997362 72735941
391659615 24822653
847123746 807146317
716927270 27228801...

output:

29460406042
408
63738 74193 16632 52370 11900 65095 48558 45068 24038 31208 9936 22344 35921 42017 47694 56269 59395 15378 58017 36703 42214 46343 56219 64164 34186 83241 48409 45168 35909 8916 14492 72935 13792 43786 260 9562 3524 78446 26260 12927 11993 40634 36905 42607 57791 27132 87314 90327 13...

result:

ok 

Test #21:

score: 0
Accepted
time: 410ms
memory: 11800kb

input:

98595
2082 28980
6196 92631
29892 27425
98594 88352
57561 95089
45551 66077
34734 62451
67272 59109
14759 36907
72279 89460
24055 56824
2918 7715
33815 35878
86740 13434
54603 13141
98349 96408
29069 10950
66766 17421
50974 55869
54248 44747
4111 6018
76243 70533
11463 37947
7500 27076
928 18088
894...

output:

353
533
48921 6417 80040 32058 79658 250 93373 11741 79826 35374 63523 56802 41552 15496 64492 94503 19328 7382 37674 93146 73547 66326 19721 66279 36521 67090 8365 88879 2403 21481 47435 78393 12713 60822 55711 75627 55520 23274 88325 5234 39789 42669 80024 22833 19190 83280 88184 77861 2 58727 443...

result:

ok 

Test #22:

score: 0
Accepted
time: 1019ms
memory: 18520kb

input:

99995
811292451 500000000
500000000 509840393
500000000 628225129
135185408 500000000
500000000 738109524
707368294 500000000
500000000 680307212
500000000 661546461
64002561 500000000
500000000 564602584
585903436 500000000
18140726 500000000
500000000 524800992
230389216 500000000
253690148 500000...

output:

8
1
45908 
99994
9590 29427 97377 19156 93795 56868 17467 4627 2520 59595 84743 58636 51525 11699 15492 50573 11914 72447 90315 98761 74327 65814 85690 71591 66591 15714 82911 76025 92781 68509 5836 48875 81975 89052 19262 91537 67168 64238 53694 44019 26585 77539 75507 89607 37347 15259 91853 99515...

result:

ok 

Test #23:

score: 0
Accepted
time: 450ms
memory: 25120kb

input:

99999
997450171 550431412
418331904 993285234
582520317 993143384
479828395 407059
412912942 7642564
898003259 197355975
56882346 731617670
61855438 740892804
949288858 280592794
742027594 62481265
191382625 893389522
36601915 687782362
212308550 91057913
991602459 408747482
743510679 63304970
51215...

output:

987056680
49999
61925 63440 51980 80094 48356 51689 97645 94155 78026 41671 6870 98308 64718 47651 50211 37697 66861 50668 38421 42906 32316 17288 13949 29617 17697 43303 78367 70547 62724 24242 51080 88374 17338 55508 14759 12166 31300 87387 97251 30830 1864 48045 54686 46853 72304 80240 33675 6122...

result:

ok 

Test #24:

score: 0
Accepted
time: 248ms
memory: 24668kb

input:

99856
305 78
185 223
103 79
38 113
168 135
312 147
202 55
274 15
89 90
96 143
11 52
206 238
182 227
3 50
142 163
20 300
140 251
118 37
145 21
231 154
150 21
153 223
124 50
254 298
180 69
7 4
174 20
8 241
239 164
154 282
106 186
11 218
45 123
238 312
126 249
42 111
127 71
160 77
129 12
298 18
215 197...

output:

2
49928
42244 72468 30592 82721 14331 29636 89686 92752 24937 33651 4278 35180 9653 90905 74372 3385 60317 22537 16188 81821 87267 92761 1480 59372 5867 177 61362 65727 67605 80798 44153 11320 51450 11092 33191 89890 26147 56169 26010 96616 41436 65384 79012 6871 27845 8252 14498 30429 23891 33609 8...

result:

ok 

Test #25:

score: 0
Accepted
time: 533ms
memory: 11400kb

input:

99521
141042363 89491445
469322351 365495982
353719483 948010497
615938040 258706079
680242542 559864723
574606403 305078347
913240642 978892350
128440632 535274846
149965767 654239680
504436456 35604103
96934630 938551477
31524409 601512784
635452664 312972306
410719949 432007286
634269718 63563199...

output:

585256433
49521
98453 75 19566 54449 92426 33588 32688 78288 33399 15544 36355 54014 8844 87111 35460 10661 51357 87052 25032 5507 34157 99433 17254 46274 61724 61167 28871 29587 17674 91531 58821 38746 67325 77141 80373 59583 95869 5258 62099 92147 91525 58843 94498 25381 94515 30374 63833 85986 46...

result:

ok 

Test #26:

score: 0
Accepted
time: 865ms
memory: 11376kb

input:

100000
998357611 31436018
223544476 30057220
675430006 288074149
434210883 335374061
629397359 111950068
737202797 774741429
426822825 479813640
29949399 157030324
903152268 416630858
643648519 445607548
725128645 480749433
373173056 803752391
459028971 137528873
429175672 662062003
843395645 240277...

output:

38995488925
620
27250 60011 1615 53643 5206 24914 94289 69298 3886 16719 69679 7560 74380 96876 87842 51723 56491 49347 88176 33658 44926 55025 27523 77046 42868 59352 61070 16599 35787 39872 14871 61675 39940 28522 69754 71843 11820 16215 31503 83749 33045 33915 83416 16917 13901 90732 49742 60033 ...

result:

ok 

Test #27:

score: 0
Accepted
time: 428ms
memory: 20868kb

input:

100000
409827459 80506748
134135815 551356606
922701497 271914546
150707196 317336470
577192487 62308992
997346456 474790833
122932288 464487000
243376127 731742953
991324794 439058163
526692240 60894836
190298126 672975000
983435733 406485488
927817099 279939128
123144880 447124734
573185681 793808...

output:

968000000
48713
26830 26180 82778 46397 79385 99581 53824 73583 33930 57429 26207 85866 3751 55882 2569 34197 50489 36924 67243 94218 59173 25287 10837 57027 74274 12669 78470 20174 47034 56257 91344 22942 52090 45847 62051 70584 36923 21004 72540 62249 23632 42981 65363 66376 12473 44692 98740 1881...

result:

ok 

Extra Test:

score: 0
Extra Test Passed