QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#17006#2120. Mopadulo [B]qwq#10 ✓171ms19124kbC++143.5kb2021-12-31 13:22:452022-05-04 12:45:15

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 1
Accepted

Test #1:

score: 1
Accepted
time: 3ms
memory: 3828kb

input:

4
1000000006 1 5 1000000004

output:

3

result:

ok single line: '3'

Test #2:

score: 0
Accepted
time: 3ms
memory: 3832kb

input:

1
1

output:

0

result:

ok single line: '0'

Test #3:

score: 0
Accepted
time: 3ms
memory: 3700kb

input:

1
2

output:

1

result:

ok single line: '1'

Test #4:

score: 0
Accepted
time: 3ms
memory: 3776kb

input:

2
2 4

output:

2

result:

ok single line: '2'

Test #5:

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

input:

3
3 2 1

output:

1

result:

ok single line: '1'

Test #6:

score: 0
Accepted
time: 2ms
memory: 3788kb

input:

4
0 0 0 0

output:

8

result:

ok single line: '8'

Test #7:

score: 0
Accepted
time: 3ms
memory: 3792kb

input:

4
0 1 0 1

output:

2

result:

ok single line: '2'

Test #8:

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

input:

4
1000000006 1 1000000006 1

output:

2

result:

ok single line: '2'

Test #9:

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

input:

17
363247819 402202959 167555624 902487605 83508304 621133631 100989324 70289756 760099679 370079310 586609922 660504165 768538005 453077474 837347401 343821496 252992907

output:

9

result:

ok single line: '9'

Test #10:

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

input:

14
113695834 479482181 329233361 265427267 33460479 265106153 729765366 168563869 494681776 745968306 710489389 886431758 627687941 435400538

output:

186

result:

ok single line: '186'

Test #11:

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

input:

15
974830845 257281827 41345106 966363992 365308638 322392581 337671583 530691651 356775623 226160676 148807414 262202584 709445637 71207501 868269656

output:

40

result:

ok single line: '40'

Test #12:

score: 0
Accepted
time: 3ms
memory: 3692kb

input:

15
65674971 262896879 979124484 199276608 999110721 955642847 103717713 405328457 859882982 899664319 60339367 440049795 522024868 837113340 221652191

output:

74

result:

ok single line: '74'

Test #13:

score: 0
Accepted
time: 3ms
memory: 3780kb

input:

16
256886744 33450616 335800049 646664961 422168189 154396697 668644303 813620313 539747279 329189058 112807399 797503430 961639639 904050805 709297938 798294306

output:

171

result:

ok single line: '171'

Test #14:

score: 0
Accepted
time: 3ms
memory: 3796kb

input:

17
999999974 1000000004 999999934 999999907 999999991 999999967 999999950 999999911 999999978 999999947 1000000005 999999926 999999962 999999977 999999924 1000000003 999999993

output:

247

result:

ok single line: '247'

Test #15:

score: 0
Accepted
time: 3ms
memory: 3696kb

input:

15
999999998 1000000004 999999928 999999916 999999966 1000000004 999999992 999999990 999999986 999999970 1000000002 999999942 1000000006 999999986 999999950

output:

610

result:

ok single line: '610'

Test #16:

score: 0
Accepted
time: 3ms
memory: 3784kb

input:

16
999999999 999999929 999999943 999999955 999999921 999999967 999999943 999999931 999999911 999999961 999999975 999999945 1000000001 999999977 999999993 999999919

output:

0

result:

ok single line: '0'

Subtask #2:

score: 1
Accepted

Test #17:

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

input:

2625
368425041 791337548 188555509 170266856 21098665 290593193 204408312 631363050 490281178 368425041 791337548 188555509 170266856 21098665 290593193 204408312 631363050 490281178 368425041 791337548 188555509 170266856 21098665 290593193 204408312 631363050 490281178 368425041 791337548 18855550...

output:

83525493

result:

ok single line: '83525493'

Test #18:

score: 0
Accepted
time: 4ms
memory: 3728kb

input:

2967
327622141 216277962 434187190 793686093 924342311 817748430 538745369 622641192 660696260 350930269 552478766 888448427 74443572 22548951 663061257 359488367 458700851 704404396 156724171 969490569 358651759 490632865 963053948 118196453 513320183 22793179 603637393 689996774 942690471 98178911...

output:

575912670

result:

ok single line: '575912670'

Test #19:

score: 0
Accepted
time: 4ms
memory: 3812kb

input:

2928
284532497 834299688 247937781 301115381 287970117 393064426 283531068 271333195 785174022 890566611 999372832 751568343 384339805 220532269 590790931 605040565 635854125 949005955 664330232 784488485 279511324 53154042 777198909 892157775 374733466 845228458 518375340 819001366 61814298 6353551...

output:

883090245

result:

ok single line: '883090245'

Test #20:

score: 0
Accepted
time: 4ms
memory: 3632kb

input:

2941
928094869 200664584 522922555 459044503 208005676 190961191 512142551 991117538 284564557 906127970 768281114 721131290 9680733 23981112 490673604 175899953 635277768 398145710 295768269 789992307 172298546 487152122 10339362 834061691 28122257 111520108 292773479 770322856 92477541 48699405 59...

output:

698176299

result:

ok single line: '698176299'

Test #21:

score: 0
Accepted
time: 4ms
memory: 3596kb

input:

2047
117707236 504710625 304433686 939676820 159559898 301595159 977735732 115098693 85247476 107459112 714411469 983063545 579766376 897495543 851838576 566241197 66313715 356601413 877444633 858234926 745342420 817556232 494154528 638939717 622909203 459238609 447497096 897652062 646712846 7174994...

output:

937683096

result:

ok single line: '937683096'

Test #22:

score: 0
Accepted
time: 4ms
memory: 3676kb

input:

2049
183711766 375237447 393760471 487143531 197035564 277352145 199175451 228955516 617311113 655431617 162846912 25293193 621641229 466818678 763827578 148641811 630412416 216712918 110486029 29576296 35472842 459462750 918838187 975311259 171335370 971348129 626112921 509827576 781928472 47855045...

output:

842537224

result:

ok single line: '842537224'

Test #23:

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

input:

2999
985757180 717465066 8965567 33180088 244014093 217949950 411178480 29954180 626023591 789621141 910737882 729083354 576156887 786710569 856189445 107227238 251739997 974293268 360084828 6750164 199398382 12556802 487748722 93328041 71675260 358149696 730333155 905965930 586534185 589933630 8813...

output:

313834203

result:

ok single line: '313834203'

Test #24:

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

input:

2991
999999909 999999972 1000000002 999999989 999999970 999999965 999999906 999999950 999999958 999999981 999999907 999999964 999999997 999999918 999999992 999999990 999999942 999999974 999999912 999999965 999999974 1000000005 999999918 999999942 999999908 999999929 999999995 999999962 999999934 100...

output:

262912195

result:

ok single line: '262912195'

Test #25:

score: 0
Accepted
time: 4ms
memory: 3608kb

input:

2948
999999923 999999995 999999921 999999991 999999957 999999985 999999941 999999979 999999933 999999939 999999959 999999923 1000000005 999999993 999999979 999999943 999999995 999999999 999999937 999999939 999999943 999999917 999999963 999999953 999999981 999999999 999999993 999999981 999999947 9999...

output:

0

result:

ok single line: '0'

Subtask #3:

score: 1
Accepted

Test #26:

score: 1
Accepted
time: 3ms
memory: 3684kb

input:

2531
418437704 418437704 418437704 418437704 418437704 418437704 418437704 418437704 418437704 418437704 418437704 418437704 418437704 418437704 418437704 418437704 418437704 418437704 418437704 418437704 418437704 418437704 418437704 418437704 418437704 418437704 418437704 418437704 418437704 41843...

output:

507676402

result:

ok single line: '507676402'

Test #27:

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

input:

2943
920357711 9969117 638830199 810704956 770124581 298853880 785152642 334909987 131359900 284741495 730614873 176884951 569460237 317744342 88746322 804915401 281633952 579244529 670001670 582660355 789549774 49389472 393485565 312494314 998794066 549776635 207637545 545841061 14771131 197194051 ...

output:

540102844

result:

ok single line: '540102844'

Test #28:

score: 0
Accepted
time: 4ms
memory: 3676kb

input:

2928
78103777 537922098 592772055 57850709 98836580 207704640 100368150 794055429 728207772 909285434 303385576 961982469 100621263 19103703 738106431 222995509 151564007 825389752 233192606 482720713 519774246 554990283 182951124 790062630 176158941 69694142 652325415 132585227 781068040 475568899 ...

output:

148247141

result:

ok single line: '148247141'

Test #29:

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

input:

2976
180273460 722926911 345005818 186220746 740041313 28545497 908613564 80991089 744241234 690672827 496446139 7270946 862016030 462800456 522839147 504518804 570787344 849821406 243365682 529198981 401871494 702948129 261081621 998787263 88642748 950353122 296685090 706772056 692975946 486212566 ...

output:

858909693

result:

ok single line: '858909693'

Test #30:

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

input:

2048
708338155 68330807 5691473 216806393 118729074 889459206 813333965 471818694 823026739 431549406 985162021 957661572 383624716 403150044 597990571 113965370 254052352 242836221 845488336 701436520 198897334 296868153 741490064 555555260 243997305 317069289 125194303 188580086 364939628 79792401...

output:

936813501

result:

ok single line: '936813501'

Test #31:

score: 0
Accepted
time: 6ms
memory: 3728kb

input:

3000
608046495 769630181 524548020 703797880 176582103 207495626 699055928 459694845 288647992 416346250 325255750 977325987 201788295 616348358 232117220 568109308 61604092 445191940 538106552 478012743 713243538 433643055 72742862 387926481 767977460 749546964 467632995 445144317 746193554 4940289...

output:

904913077

result:

ok single line: '904913077'

Test #32:

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

input:

2998
626745716 19631440 483328706 650636955 51386379 239030178 978463911 725691610 365122065 775958334 610763717 559397661 729093838 930018829 66700471 961417762 807648990 82415055 874199918 75932811 669770217 167969129 950348310 784428764 191630237 146972108 418199476 220984991 317927493 637690929 ...

output:

976746797

result:

ok single line: '976746797'

Test #33:

score: 0
Accepted
time: 3ms
memory: 3816kb

input:

2930
999999920 999999990 999999932 999999980 999999932 999999986 999999910 999999964 999999934 999999962 1000000000 999999922 999999912 999999946 999999948 999999986 999999920 999999976 999999980 999999908 999999912 999999988 999999988 999999962 999999982 999999938 999999984 999999992 999999918 9999...

output:

172617221

result:

ok single line: '172617221'

Subtask #4:

score: 1
Accepted

Test #34:

score: 1
Accepted
time: 64ms
memory: 12256kb

input:

188249
77 28 58 90 51 77 28 58 90 51 77 28 58 90 51 77 28 58 90 51 77 28 58 90 51 77 28 58 90 51 77 28 58 90 51 77 28 58 90 51 77 28 58 90 51 77 28 58 90 51 77 28 58 90 51 77 28 58 90 51 77 28 58 90 51 77 28 58 90 51 77 28 58 90 51 77 28 58 90 51 77 28 58 90 51 77 28 58 90 51 77 28 58 90 51 77 28 58...

output:

0

result:

ok single line: '0'

Test #35:

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

input:

160314
52 42 72 14 86 96 52 42 72 14 86 96 52 42 72 14 86 96 52 42 72 14 86 96 52 42 72 14 86 96 52 42 72 14 86 96 52 42 72 14 86 96 52 42 72 14 86 96 52 42 72 14 86 96 52 42 72 14 86 96 52 42 72 14 86 96 52 42 72 14 86 96 52 42 72 14 86 96 52 42 72 14 86 96 52 42 72 14 86 96 52 42 72 14 86 96 52 42...

output:

98552652

result:

ok single line: '98552652'

Test #36:

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

input:

296464
22 73 77 52 20 85 12 60 91 53 1 23 70 38 80 46 49 36 72 25 71 98 68 99 51 39 78 7 75 40 70 6 45 55 98 85 53 62 40 5 62 6 16 12 58 94 56 43 19 78 84 71 0 37 46 5 70 75 33 85 75 41 4 8 28 70 52 58 36 22 4 26 2 20 16 28 74 100 81 30 22 82 21 88 44 73 60 31 73 32 52 31 65 52 84 33 62 33 35 50 96 ...

output:

802815699

result:

ok single line: '802815699'

Test #37:

score: 0
Accepted
time: 101ms
memory: 18376kb

input:

299999
7 27 2 15 10 47 73 1 6 95 15 38 48 33 78 24 69 30 26 60 64 48 57 30 100 83 57 29 0 23 15 30 73 15 39 23 23 48 10 6 39 21 49 7 47 4 57 91 47 61 1 58 56 30 88 11 19 78 49 46 77 13 94 46 17 74 13 69 27 88 12 86 89 88 61 44 60 15 11 22 60 38 53 3 37 40 58 87 16 14 32 58 10 42 15 73 6 46 32 62 71 ...

output:

55561180

result:

ok single line: '55561180'

Test #38:

score: 0
Accepted
time: 96ms
memory: 17560kb

input:

299997
41 0 67 51 92 8 75 98 20 91 83 13 1 27 61 90 14 65 24 58 98 24 0 35 61 45 93 66 32 1 73 15 80 13 18 94 20 62 15 55 64 60 3 43 42 81 96 79 83 96 66 77 3 8 6 15 5 83 6 44 26 66 96 20 12 37 10 65 64 27 86 19 93 12 87 63 97 38 7 9 10 15 81 24 67 38 91 93 10 3 79 17 32 50 94 66 14 14 68 44 95 67 5...

output:

0

result:

ok single line: '0'

Test #39:

score: 0
Accepted
time: 94ms
memory: 17472kb

input:

300000
85 39 58 11 82 66 16 87 100 58 21 14 26 53 97 38 0 7 82 87 31 60 23 87 16 75 34 4 93 17 35 97 72 25 17 13 43 63 67 47 14 33 48 14 34 28 74 29 22 75 59 42 43 85 48 74 78 19 73 94 92 14 98 5 60 16 35 55 46 29 86 10 53 44 48 84 20 99 66 74 63 86 7 29 23 84 58 59 47 89 86 97 11 82 17 76 52 27 22 ...

output:

517447840

result:

ok single line: '517447840'

Test #40:

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

input:

262143
79 93 39 87 65 73 3 80 8 65 77 25 2 72 72 36 86 46 23 18 4 3 20 59 31 90 81 52 70 89 62 0 27 19 51 2 79 86 11 77 8 54 88 18 85 58 15 68 5 37 29 87 74 56 23 28 11 85 0 33 77 61 23 37 73 2 27 91 87 100 81 39 9 76 76 46 62 50 95 52 91 24 54 17 9 99 18 57 46 32 43 77 77 5 98 30 24 11 74 53 13 11 ...

output:

796780544

result:

ok single line: '796780544'

Test #41:

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

input:

262145
68 32 16 98 16 82 100 43 77 79 26 54 22 87 88 67 96 47 53 47 39 30 88 28 16 47 14 84 8 42 85 93 49 66 82 65 1 72 49 43 75 20 33 75 51 38 66 52 86 63 75 49 60 61 16 48 100 39 72 50 3 40 5 48 85 17 6 15 74 18 26 85 31 54 52 31 80 36 1 89 73 42 67 50 30 37 40 12 22 99 65 6 59 69 53 54 80 8 87 78...

output:

0

result:

ok single line: '0'

Subtask #5:

score: 1
Accepted

Test #42:

score: 1
Accepted
time: 18ms
memory: 6184kb

input:

57090
69 54 75 0 96 12 5 15 18 69 54 75 0 96 12 5 15 18 69 54 75 0 96 12 5 15 18 69 54 75 0 96 12 5 15 18 69 54 75 0 96 12 5 15 18 69 54 75 0 96 12 5 15 18 69 54 75 0 96 12 5 15 18 69 54 75 0 96 12 5 15 18 69 54 75 0 96 12 5 15 18 69 54 75 0 96 12 5 15 18 69 54 75 0 96 12 5 15 18 69 54 75 0 96 12 5 ...

output:

380380762

result:

ok single line: '380380762'

Test #43:

score: 0
Accepted
time: 86ms
memory: 18744kb

input:

292273
42 37 8 80 35 63 20 34 59 74 59 92 61 59 15 61 80 63 60 54 25 4 67 34 22 84 90 98 70 12 60 69 49 43 56 15 53 9 24 100 69 70 11 66 87 82 28 49 99 98 14 76 61 42 74 50 68 23 66 34 60 86 56 86 17 55 23 3 77 54 34 68 24 89 85 14 48 38 84 44 63 51 50 28 44 56 37 46 62 8 51 66 40 27 12 12 57 22 86 ...

output:

0

result:

ok single line: '0'

Test #44:

score: 0
Accepted
time: 97ms
memory: 19124kb

input:

295084
11 55 60 14 44 54 79 97 45 46 82 52 23 63 33 0 18 96 21 75 69 19 80 99 49 65 16 40 92 46 59 38 13 27 88 78 48 1 87 11 37 65 9 77 83 53 1 82 53 93 16 9 44 95 72 18 69 5 51 73 74 52 96 81 5 69 99 27 87 49 58 46 60 22 97 53 10 1 28 28 80 24 9 24 63 19 27 31 90 34 63 26 4 20 94 4 72 61 92 55 70 5...

output:

0

result:

ok single line: '0'

Test #45:

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

input:

299998
100 22 21 37 96 1 76 80 51 85 0 66 28 56 27 83 83 82 70 16 87 4 90 10 46 7 31 14 97 48 5 5 10 1 20 19 47 16 70 81 56 4 29 16 32 37 31 54 1 85 26 28 75 94 79 11 50 26 6 52 70 82 34 80 7 29 1 19 19 73 80 93 81 65 54 24 53 64 31 18 4 65 26 2 54 19 52 99 37 85 76 59 27 28 31 49 84 16 2 99 66 49 7...

output:

698672909

result:

ok single line: '698672909'

Test #46:

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

input:

300000
42 45 57 86 59 67 51 27 56 87 10 84 12 97 76 71 68 9 0 40 55 100 76 62 15 27 93 100 19 6 19 49 37 37 16 49 27 11 44 24 88 94 72 40 58 62 27 72 91 37 91 32 99 17 12 75 17 43 43 32 77 50 34 33 23 54 85 97 30 59 43 8 60 77 38 59 88 41 63 22 82 70 95 21 53 41 72 24 94 34 100 18 84 72 100 62 64 15...

output:

0

result:

ok single line: '0'

Test #47:

score: 0
Accepted
time: 91ms
memory: 18860kb

input:

300000
94 69 17 4 21 72 79 0 11 3 77 42 2 94 0 98 73 100 99 64 3 40 28 84 7 57 29 10 21 35 35 38 48 82 6 54 35 91 96 55 33 37 3 37 27 72 35 7 24 63 5 4 42 79 0 72 78 17 54 12 59 19 90 88 20 23 61 76 24 39 20 52 87 6 10 62 22 2 32 46 39 23 90 94 50 18 35 3 27 80 92 8 75 40 47 86 33 65 66 78 8 91 83 1...

output:

330493991

result:

ok single line: '330493991'

Test #48:

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

input:

262144
10 89 83 2 37 73 24 22 25 76 27 51 16 33 38 72 73 20 47 92 16 81 70 71 95 85 1 14 3 58 88 14 71 17 25 6 69 27 3 29 100 8 10 50 77 38 56 84 4 32 30 1 39 79 50 48 11 28 87 0 18 16 98 75 8 43 78 41 69 77 75 45 28 89 14 2 99 86 35 71 74 80 37 61 49 66 41 0 64 92 82 40 29 85 48 26 70 90 17 65 90 8...

output:

316362971

result:

ok single line: '316362971'

Subtask #6:

score: 1
Accepted

Test #49:

score: 1
Accepted
time: 58ms
memory: 10192kb

input:

145848
912955542 748134335 39317448 44915031 743171518 826778140 963436905 123059026 688127586 600974396 912955542 748134335 39317448 44915031 743171518 826778140 963436905 123059026 688127586 600974396 912955542 748134335 39317448 44915031 743171518 826778140 963436905 123059026 688127586 600974396...

output:

149573466

result:

ok single line: '149573466'

Test #50:

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

input:

146897
483050919 728813337 35170328 39586885 283458491 397111008 262411591 229343109 709127049 220380272 902568076 656501074 959566093 297674999 819413673 696777402 181961798 971441117 372196376 668590517 320235769 936960638 155617303 51128809 617831644 605205830 971468698 290485078 150279635 895365...

output:

993438576

result:

ok single line: '993438576'

Test #51:

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

input:

148015
750933365 185526028 677445022 473687822 691440711 867888818 732261681 360112786 86294882 1847088 347755116 429828115 366230983 255621272 597815016 985658572 393924185 672079538 855449851 412166671 933163965 880433936 61000530 577770952 593182653 674538838 208389508 849139147 617584117 4626598...

output:

166909227

result:

ok single line: '166909227'

Test #52:

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

input:

131071
543198005 493071762 309723310 366248275 230087220 168219 590283820 938537894 8527441 260914131 758710215 32234441 625680815 647466858 866424094 209111360 90046889 420523396 501277513 945590268 551573232 813739179 504725969 325251105 207456355 953513779 987201562 596730607 851992159 259999231 ...

output:

935991825

result:

ok single line: '935991825'

Test #53:

score: 0
Accepted
time: 55ms
memory: 9560kb

input:

131072
390838744 646862444 291892426 436372805 135734017 582475297 133406979 383833115 298490434 270247343 38147959 445837011 788771669 502475492 639149125 738140713 790523973 102127385 960567196 710436131 883249073 17323912 269130666 703691370 473020006 161144061 170969304 693031421 660734095 93835...

output:

11668274

result:

ok single line: '11668274'

Test #54:

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

input:

148659
999999929 999999923 999999980 999999948 999999979 999999966 999999951 999999917 999999937 999999908 999999951 999999942 999999912 999999949 999999983 999999935 999999914 999999982 999999908 1000000002 999999950 999999986 999999942 999999924 1000000005 999999922 999999967 999999951 999999948 9...

output:

142727633

result:

ok single line: '142727633'

Test #55:

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

input:

149575
999999910 999999934 999999998 999999960 999999946 999999982 999999924 999999924 999999984 999999980 999999972 999999988 999999966 999999990 999999918 999999932 999999920 999999958 999999982 999999940 1000000000 999999956 999999964 999999946 999999926 999999934 999999976 999999950 999999914 99...

output:

122485308

result:

ok single line: '122485308'

Test #56:

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

input:

142193
999999939 999999913 999999989 999999945 999999923 999999925 999999967 999999959 999999983 999999985 999999909 999999907 999999909 999999943 999999923 999999949 999999965 999999943 999999993 999999909 999999937 999999909 999999921 999999963 999999927 999999973 999999929 999999997 999999981 999...

output:

0

result:

ok single line: '0'

Subtask #7:

score: 1
Accepted

Test #57:

score: 1
Accepted
time: 77ms
memory: 12672kb

input:

198147
276162186 281714658 892546195 229146837 71794636 299635788 555482085 689418119 238278860 276162186 281714658 892546195 229146837 71794636 299635788 555482085 689418119 238278860 276162186 281714658 892546195 229146837 71794636 299635788 555482085 689418119 238278860 276162186 281714658 892546...

output:

665938579

result:

ok single line: '665938579'

Test #58:

score: 0
Accepted
time: 90ms
memory: 12560kb

input:

196166
43472845 459663003 733718822 393323823 375990735 269859086 277079875 877360615 173341375 846896846 82917837 166675445 483849034 701748809 993340824 223252740 934358356 98420190 181614354 773819028 401019460 120451028 260955584 18809983 680278273 179844369 530069705 384233821 90486690 39234049...

output:

975900885

result:

ok single line: '975900885'

Test #59:

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

input:

196392
936826322 253844121 534610478 926237214 543779147 573889253 645007572 271513748 69148652 597417601 975846824 89906003 393391275 953718633 571281125 865407489 404337317 617832549 667169263 332388612 681019192 274509939 176834871 835480610 682157675 349138084 93118258 81058912 125990883 2427049...

output:

517143256

result:

ok single line: '517143256'

Test #60:

score: 0
Accepted
time: 93ms
memory: 12512kb

input:

197142
611200827 531611774 459825442 725809403 528989511 697715146 276627116 845437963 84911821 679983855 659453354 279428205 709552238 801162976 596350788 764763759 655615635 127550038 944273288 871546360 654815516 167493782 974213641 226021489 269432917 829844764 694303927 919536654 950967646 3006...

output:

732041040

result:

ok single line: '732041040'

Test #61:

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

input:

192084
999999947 999999971 999999960 999999945 999999909 999999970 1000000004 999999942 999999977 999999951 999999934 999999915 999999925 999999946 999999999 999999987 999999926 999999996 999999942 999999975 999999977 999999939 999999971 999999980 999999906 999999909 999999976 999999971 999999932 10...

output:

635285187

result:

ok single line: '635285187'

Test #62:

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

input:

194510
999999977 999999989 999999955 999999991 999999939 999999991 999999907 999999905 999999967 999999939 999999961 999999943 999999931 999999943 999999955 999999931 999999907 999999929 999999965 999999927 999999939 999999907 999999947 999999967 999999971 999999983 999999961 999999927 999999905 999...

output:

0

result:

ok single line: '0'

Subtask #8:

score: 1
Accepted

Test #63:

score: 1
Accepted
time: 84ms
memory: 12704kb

input:

198430
811971286 254863754 212045166 340871042 957770862 795407433 833290718 811971286 254863754 212045166 340871042 957770862 795407433 833290718 811971286 254863754 212045166 340871042 957770862 795407433 833290718 811971286 254863754 212045166 340871042 957770862 795407433 833290718 811971286 254...

output:

636458412

result:

ok single line: '636458412'

Test #64:

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

input:

195265
962251265 988229283 861988979 799724992 216116523 233587659 343290475 345086319 48516974 31812205 674461355 5322043 273902462 259689107 207946668 876382324 123976755 257307493 735324958 767736445 293093343 489249728 665360852 794110444 831020072 214016484 50631437 36765990 561504083 308938897...

output:

717898312

result:

ok single line: '717898312'

Test #65:

score: 0
Accepted
time: 90ms
memory: 12904kb

input:

197802
108383781 296257010 188553903 474351545 186600602 636838324 113914847 677717360 51057660 876039032 114703405 24425776 694445234 831305079 44916368 272000782 760265460 141007856 668239179 222297059 631461486 506797095 13404718 980062493 887831131 194841863 80396913 877898050 691527086 88641185...

output:

579798728

result:

ok single line: '579798728'

Test #66:

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

input:

198844
555103577 358045909 499907182 626585452 196024615 8252315 214656491 532842153 848307752 232635510 132495784 869314677 330947157 116174180 922495037 46164241 347894893 68338070 282638 886118662 939225274 112211213 5372611 616001719 446618439 219036583 107608700 43991671 996614953 246729874 469...

output:

70926506

result:

ok single line: '70926506'

Test #67:

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

input:

191980
999999958 999999948 999999946 999999984 999999948 999999956 999999974 999999982 999999988 999999982 999999926 999999948 999999956 999999920 999999988 999999984 999999978 999999990 999999946 999999972 999999972 999999986 999999906 999999912 999999940 999999930 999999924 999999910 999999914 999...

output:

373441279

result:

ok single line: '373441279'

Subtask #9:

score: 1
Accepted

Test #68:

score: 1
Accepted
time: 131ms
memory: 18664kb

input:

297590
89251679 929510570 89251679 929510570 89251679 929510570 89251679 929510570 89251679 929510570 89251679 929510570 89251679 929510570 89251679 929510570 89251679 929510570 89251679 929510570 89251679 929510570 89251679 929510570 89251679 929510570 89251679 929510570 89251679 929510570 89251679...

output:

231322216

result:

ok single line: '231322216'

Test #69:

score: 0
Accepted
time: 142ms
memory: 18732kb

input:

295367
589191890 46566542 375320604 274802297 664050960 591470892 125199932 268219980 111489887 160493997 167091917 235933917 924549387 103738655 245807253 99630537 182906873 188539085 102349870 837748723 997061770 129293612 739891267 444066417 494592663 112517258 128883022 654996438 287653399 95521...

output:

381771828

result:

ok single line: '381771828'

Test #70:

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

input:

299116
398081407 778732853 59104680 209441573 731579785 540030392 928993915 950455254 279876019 78874627 934912036 958585277 66209507 206202778 800988580 129504750 215526907 491398782 626426560 801757187 973167258 677116159 167966198 915592631 442811531 241357710 860389743 537192674 200696843 848837...

output:

255491821

result:

ok single line: '255491821'

Test #71:

score: 0
Accepted
time: 153ms
memory: 18284kb

input:

295264
746033947 226709988 16482839 501224649 921300409 900829230 531853761 486128544 2875686 74068879 931608339 499494360 557551336 198478457 66864857 662051 157865805 694410531 421035547 958733899 519285124 598325015 197283203 838879057 333027214 974369605 125307415 516956004 27844465 4938558 8484...

output:

404090527

result:

ok single line: '404090527'

Test #72:

score: 0
Accepted
time: 143ms
memory: 17656kb

input:

300000
680694281 822762957 586116569 198144860 954908902 475327133 439575413 42901378 305427425 471467075 404572972 259473018 350389586 492026448 886551519 389546902 488526981 85329505 471648847 350922653 186521667 972401151 888506314 959113068 861788953 60464132 134953168 322308761 147242081 183467...

output:

909862696

result:

ok single line: '909862696'

Test #73:

score: 0
Accepted
time: 143ms
memory: 17344kb

input:

299998
876210177 642481632 212262122 262468912 941549606 485355941 858880716 857181271 543087213 436140297 461626408 933251163 320343158 948495277 722189630 241661601 929840638 398310403 376582639 531520630 767320193 303353932 516905781 982560624 63554793 104930148 630743921 241243344 120313697 1214...

output:

977115327

result:

ok single line: '977115327'

Test #74:

score: 0
Accepted
time: 161ms
memory: 18220kb

input:

300000
682587281 443627273 687336798 506597256 478104534 160963049 240096007 747723189 5989035 897244377 801305613 524528740 872294954 965028908 35609827 14636357 811179209 382125488 351277555 327569249 423131745 897358938 836599595 229295391 285535571 378398198 394520773 460959053 177499412 2333337...

output:

289084804

result:

ok single line: '289084804'

Test #75:

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

input:

299978
63887868 879539546 522655110 839439611 776431077 528886090 677754480 765776087 758885214 844543205 28089952 191904177 537619351 946420203 718223203 438379853 6450300 818443804 108975750 874757721 599432823 478857667 908304727 33200753 877736528 828014954 926983157 419795185 489695970 55657900...

output:

95887183

result:

ok single line: '95887183'

Test #76:

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

input:

262143
444679177 433987953 188640378 633592801 193916719 662740290 230447877 720439684 75631677 658304031 49651716 241471611 93251370 757559882 909695886 333647175 214681364 560193032 823494635 82304521 484133688 925719669 628935707 390595630 845752078 977153582 274754883 130479173 955525750 7743206...

output:

144227618

result:

ok single line: '144227618'

Test #77:

score: 0
Accepted
time: 110ms
memory: 16180kb

input:

262145
532351340 582930750 815485813 644867972 169354887 681067700 917957440 58796694 19532918 796360075 262170593 852186701 714657957 787809532 815982587 444852916 217488313 212712449 742125004 709509819 859155555 689159534 626931025 461198965 198963719 684957789 408950124 715031885 30980047 853964...

output:

547216091

result:

ok single line: '547216091'

Test #78:

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

input:

290751
999999928 999999950 1000000000 999999996 999999946 999999922 999999948 999999966 999999980 999999946 999999942 999999976 1000000006 999999964 999999924 999999922 999999954 1000000002 999999930 999999984 999999968 999999936 999999964 999999980 999999980 999999954 999999972 999999934 999999998 ...

output:

486244456

result:

ok single line: '486244456'

Subtask #10:

score: 1
Accepted

Test #79:

score: 1
Accepted
time: 147ms
memory: 18652kb

input:

296417
668871948 668871948 668871948 668871948 668871948 668871948 668871948 668871948 668871948 668871948 668871948 668871948 668871948 668871948 668871948 668871948 668871948 668871948 668871948 668871948 668871948 668871948 668871948 668871948 668871948 668871948 668871948 668871948 668871948 668...

output:

525579539

result:

ok single line: '525579539'

Test #80:

score: 0
Accepted
time: 155ms
memory: 18508kb

input:

297797
772109034 47285029 833045657 469913587 163666642 489030637 504458799 757068654 947777391 207215736 712462555 40866849 359391586 598731773 327803135 303576872 793505201 138920122 374614529 537904010 615683770 426547027 700189350 846675854 361553639 910042704 537923722 314603476 92317930 813909...

output:

61884988

result:

ok single line: '61884988'

Test #81:

score: 0
Accepted
time: 147ms
memory: 17608kb

input:

298930
379259940 619075107 431908112 298527371 615990822 40639002 591979862 635373007 188803531 321843154 431429159 691318970 246842075 568335515 817313142 665686802 544989846 274921930 486962043 715293726 224058832 937016248 402328974 16852040 718987015 196218098 342329627 846241602 10375821 249552...

output:

335237724

result:

ok single line: '335237724'

Test #82:

score: 0
Accepted
time: 171ms
memory: 18820kb

input:

297453
220749194 630826362 643899735 833858300 261533888 702442479 454395255 702349162 245823990 624319432 607689005 888150058 680791966 190233436 247280600 711288250 220461163 982850268 792562529 389202701 61593881 680273330 26013849 314747661 953117321 4358665 792708438 822493412 284712783 6368914...

output:

536552891

result:

ok single line: '536552891'

Test #83:

score: 0
Accepted
time: 134ms
memory: 18544kb

input:

299999
44244476 988090336 567089783 345209593 133388281 164370922 882297705 994277360 227574585 780462568 184713493 468788593 672656029 188794871 518731273 230474779 112269946 395430441 880405453 862262356 168123185 655843971 373809592 403583573 17113825 479580402 670397193 694855950 430770866 58187...

output:

921278188

result:

ok single line: '921278188'

Test #84:

score: 0
Accepted
time: 145ms
memory: 17380kb

input:

300000
150148670 194733661 587958321 572554413 804963969 225716815 614338420 721440726 524849201 456115031 969838943 769326556 9108336 716176441 468460344 224755651 94783325 46043909 536033868 169605594 586844996 527437432 957551874 181115787 257088022 49305542 22317014 633793966 144993894 653725796...

output:

866397015

result:

ok single line: '866397015'

Test #85:

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

input:

300000
990079872 778834378 189609335 294793821 715128186 174331162 339822060 136631816 396131800 512395515 974184878 423898529 956971625 421289271 715169571 56191058 903020793 525857862 357575426 305008092 90338087 162912322 614759218 232234750 857703562 639163036 853797988 809006653 283196301 64024...

output:

496568823

result:

ok single line: '496568823'

Test #86:

score: 0
Accepted
time: 143ms
memory: 17408kb

input:

299952
812046726 64168916 118199965 677987780 51844975 426604367 258904407 215136954 258808930 516379942 96037256 707323715 440908491 705270874 339092179 203186292 969923450 718636155 516109911 888811169 182017159 224332338 266332944 847540873 415566832 763959632 707501346 3897517 707843349 10868191...

output:

67357692

result:

ok single line: '67357692'

Test #87:

score: 0
Accepted
time: 120ms
memory: 16548kb

input:

262144
5966979 197576453 905986544 950961418 900228992 71188209 518207067 597682081 224459562 434579861 471009604 302116584 461339588 132594587 271249318 389004661 276546112 308994445 534004342 89326660 579012550 844952277 140370218 246667882 291511934 962563297 419140055 870129924 506537796 9816426...

output:

859225747

result:

ok single line: '859225747'

Test #88:

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

input:

294058
999999947 999999948 999999935 999999931 999999998 999999971 999999922 999999937 999999963 999999940 999999995 999999946 999999984 999999962 1000000004 999999955 999999970 999999964 999999933 999999965 999999977 999999981 999999957 999999999 999999996 999999908 999999922 1000000005 999999933 9...

output:

334369335

result:

ok single line: '334369335'

Test #89:

score: 0
Accepted
time: 90ms
memory: 17680kb

input:

298075
1000000003 999999979 999999929 999999909 999999933 999999923 999999963 999999959 999999945 999999967 1000000001 999999965 999999965 999999931 999999921 999999977 999999913 999999967 1000000001 999999945 999999975 999999935 999999959 999999947 1000000001 999999981 999999957 999999959 999999907...

output:

0

result:

ok single line: '0'