QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#535396#4585. Greedy KnapsackDennisTran#TL 874ms5676kbC++201.7kb2024-08-28 00:49:052024-08-28 00:49:05

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

5 10
10 1 2 3 4
1 1 1 1 1

output:

3

result:

ok single line: '3'

Test #2:

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

input:

5 10000000000
10 1 2 3 4
30 2 15 7 11

output:

65

result:

ok single line: '65'

Test #3:

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

input:

5 20
4 9 5 1 3
203 175 131 218 304

output:

900

result:

ok single line: '900'

Test #4:

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

input:

1 1
1
1

output:

1

result:

ok single line: '1'

Test #5:

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

input:

100000 200000
100000 99998 99996 99994 99992 99990 99988 99986 99984 99982 99980 99978 99976 99974 99972 99970 99968 99966 99964 99962 99960 99958 99956 99954 99952 99950 99948 99946 99944 99942 99940 99938 99936 99934 99932 99930 99928 99926 99924 99922 99920 99918 99916 99914 99912 99910 99908 999...

output:

100002

result:

ok single line: '100002'

Test #6:

score: 0
Accepted
time: 283ms
memory: 5520kb

input:

92455 883403359
82193 96168 42737 25557 5699 8922 41136 82789 26249 74241 57030 29989 41743 78491 37281 60598 23165 51802 13911 88911 55220 25398 60154 2879 14519 61138 16806 15952 83710 44076 43551 41425 11055 3321 59105 34722 60133 13735 36785 73444 92250 3613 35787 10798 35612 9564 42531 49012 83...

output:

881743221

result:

ok single line: '881743221'

Test #7:

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

input:

95787 282807627
71790 93372 34507 85540 25871 70820 42496 67633 50879 43192 861 57228 54094 91534 94590 24032 52665 82236 52010 45017 15045 76804 39159 72380 28162 89590 31125 21390 37395 34002 26585 2985 90847 12060 63128 73061 34524 61847 69734 53329 39554 90867 13357 18202 63266 44796 64191 40066...

output:

287223570

result:

ok single line: '287223570'

Test #8:

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

input:

100000 100001
100000 99998 99996 99994 99992 99990 99988 99986 99984 99982 99980 99978 99976 99974 99972 99970 99968 99966 99964 99962 99960 99958 99956 99954 99952 99950 99948 99946 99944 99942 99940 99938 99936 99934 99932 99930 99928 99926 99924 99922 99920 99918 99916 99914 99912 99910 99908 999...

output:

100001

result:

ok single line: '100001'

Test #9:

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

input:

100000 200000
100000 99998 99996 99994 99992 99990 99988 99986 99984 99982 99980 99978 99976 99974 99972 99970 99968 99966 99964 99962 99960 99958 99956 99954 99952 99950 99948 99946 99944 99942 99940 99938 99936 99934 99932 99930 99928 99926 99924 99922 99920 99918 99916 99914 99912 99910 99908 999...

output:

100002

result:

ok single line: '100002'

Test #10:

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

input:

100000 101603
100000 99998 99996 99994 99992 99990 99988 99986 99984 99982 99980 99978 99976 99974 99972 99970 99968 99966 99964 99962 99960 99958 99956 99954 99952 99950 99948 99946 99944 99942 99940 99938 99936 99934 99932 99930 99928 99926 99924 99922 99920 99918 99916 99914 99912 99910 99908 999...

output:

100001

result:

ok single line: '100001'

Test #11:

score: 0
Accepted
time: 12ms
memory: 5576kb

input:

100000 200000
100000 99998 99996 99994 99992 99990 99988 99986 99984 99982 99980 99978 99976 99974 99972 99970 99968 99966 99964 99962 99960 99958 99956 99954 99952 99950 99948 99946 99944 99942 99940 99938 99936 99934 99932 99930 99928 99926 99924 99922 99920 99918 99916 99914 99912 99910 99908 999...

output:

100002

result:

ok single line: '100002'

Test #12:

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

input:

100000 109258
100000 99998 99996 99994 99992 99990 99988 99986 99984 99982 99980 99978 99976 99974 99972 99970 99968 99966 99964 99962 99960 99958 99956 99954 99952 99950 99948 99946 99944 99942 99940 99938 99936 99934 99932 99930 99928 99926 99924 99922 99920 99918 99916 99914 99912 99910 99908 999...

output:

100001

result:

ok single line: '100001'

Test #13:

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

input:

100000 200000
100000 99997 99994 99991 99988 99985 99983 99980 99977 99974 99972 99969 99966 99963 99961 99958 99955 99952 99950 99947 99944 99942 99939 99936 99933 99930 99928 99926 99923 99920 99917 99914 99912 99909 99906 99904 99901 99899 99897 99894 99891 99889 99886 99883 99881 99879 99876 998...

output:

100003

result:

ok single line: '100003'

Test #14:

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

input:

100000 104441
100000 99997 99994 99991 99988 99985 99983 99980 99977 99974 99972 99969 99966 99963 99961 99958 99955 99952 99950 99947 99944 99942 99939 99936 99933 99930 99928 99926 99923 99920 99917 99914 99912 99909 99906 99904 99901 99899 99897 99894 99891 99889 99886 99883 99881 99879 99876 998...

output:

100002

result:

ok single line: '100002'

Test #15:

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

input:

100000 200000
100000 99993 99987 99978 99972 99965 99960 99954 99948 99944 99941 99931 99929 99919 99910 99904 99894 99888 99877 99871 99863 99858 99852 99850 99843 99839 99829 99823 99812 99807 99795 99791 99780 99774 99766 99755 99750 99742 99731 99725 99718 99711 99702 99696 99693 99689 99678 996...

output:

100002

result:

ok single line: '100002'

Test #16:

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

input:

100000 100220
100000 99993 99987 99978 99972 99965 99960 99954 99948 99944 99941 99931 99929 99919 99910 99904 99894 99888 99877 99871 99863 99858 99852 99850 99843 99839 99829 99823 99812 99807 99795 99791 99780 99774 99766 99755 99750 99742 99731 99725 99718 99711 99702 99696 99693 99689 99678 996...

output:

100001

result:

ok single line: '100001'

Test #17:

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

input:

1 1
2
100000

output:

0

result:

ok single line: '0'

Test #18:

score: 0
Accepted
time: 73ms
memory: 5448kb

input:

100000 200000
100000 99991 99969 99958 99945 99932 99930 99912 99899 99891 99875 99857 99845 99830 99814 99802 99783 99766 99754 99733 99729 99726 99713 99696 99675 99665 99646 99642 99625 99621 99612 99605 99590 99585 99569 99566 99559 99552 99543 99528 99513 99497 99485 99478 99476 99457 99435 994...

output:

100003

result:

ok single line: '100003'

Test #19:

score: 0
Accepted
time: 79ms
memory: 5508kb

input:

100000 100012
100000 99991 99969 99958 99945 99932 99930 99912 99899 99891 99875 99857 99845 99830 99814 99802 99783 99766 99754 99733 99729 99726 99713 99696 99675 99665 99646 99642 99625 99621 99612 99605 99590 99585 99569 99566 99559 99552 99543 99528 99513 99497 99485 99478 99476 99457 99435 994...

output:

100002

result:

ok single line: '100002'

Test #20:

score: 0
Accepted
time: 14ms
memory: 5504kb

input:

100000 104768
42198 63876 70289 97679 99129 99383 99678 99811 99998 99999 99999 99999 100000 100000 100000 12433 8169 3583 222 37 35 9 2 1 1 1 1 1 1 1 65163 81308 91468 93404 95453 99894 99909 99998 99999 99999 99999 99999 100000 100000 100000 23740 11045 4364 2504 1858 1225 1157 1071 505 76 5 2 2 2...

output:

45

result:

ok single line: '45'

Test #21:

score: 0
Accepted
time: 12ms
memory: 5612kb

input:

100000 104790
66799 77219 97947 99699 99727 99872 99924 99980 99989 99991 100000 100000 100000 100000 100000 37709 33873 24409 1661 1157 1097 410 252 224 122 94 14 7 4 4 58118 97059 99179 99309 99324 99815 99829 99932 99933 99942 99971 99972 99992 99995 99995 71139 43023 15781 14293 3416 975 325 163...

output:

104790

result:

ok single line: '104790'

Test #22:

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

input:

100000 200000
59927 72467 75688 92437 93614 94992 97911 98151 98487 98938 99612 99947 99956 99995 99999 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 ...

output:

632

result:

ok single line: '632'

Test #23:

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

input:

100000 200000
86758 94096 95161 96612 98162 98338 98548 99356 99854 99996 99999 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100...

output:

200000

result:

ok single line: '200000'

Test #24:

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

input:

100000 150000
3841 4238 30552 47243 50833 93202 96257 97547 98352 98668 99000 99932 99987 99991 99992 99997 99998 99998 99998 99999 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 ...

output:

3855

result:

ok single line: '3855'

Test #25:

score: 0
Accepted
time: 12ms
memory: 5444kb

input:

100000 150000
10723 22346 89189 97960 99966 99968 99969 99985 99994 99994 99997 99997 99997 99999 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000...

output:

150000

result:

ok single line: '150000'

Test #26:

score: 0
Accepted
time: 852ms
memory: 5328kb

input:

90108 9829673297
3 3 5 5 5 5 5 7 9 11 13 15 15 17 17 19 20 22 22 22 22 24 25 25 25 27 28 30 30 31 32 34 34 35 35 36 37 38 39 41 42 44 44 46 48 49 49 50 51 52 53 55 55 56 57 59 61 63 65 67 69 70 71 72 72 73 75 76 77 77 78 78 80 80 80 80 81 81 81 81 82 82 82 84 86 87 89 89 90 90 90 90 92 94 95 97 99 1...

output:

4514516167

result:

ok single line: '4514516167'

Test #27:

score: 0
Accepted
time: 834ms
memory: 5576kb

input:

98347 2610706974
3 3 3 5 5 6 6 8 9 9 10 10 12 14 14 15 15 16 16 16 16 18 19 19 21 22 24 25 25 26 27 28 29 29 29 29 31 32 33 35 37 39 40 42 42 43 45 47 48 49 51 52 52 52 52 52 53 55 57 58 59 60 61 62 64 66 66 68 70 71 73 73 73 75 75 75 77 79 79 79 79 79 80 80 82 84 85 85 86 88 90 92 93 94 94 96 97 98...

output:

3635495789

result:

ok single line: '3635495789'

Test #28:

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

input:

100000 10000000000
100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 1...

output:

10000000000

result:

ok single line: '10000000000'

Test #29:

score: 0
Accepted
time: 874ms
memory: 5420kb

input:

96019 5787043590
2 2 2 4 6 7 9 10 11 11 11 13 15 16 16 18 19 19 19 20 22 22 24 25 27 27 27 29 29 29 29 29 30 31 31 31 33 34 36 36 36 38 39 40 41 42 44 46 48 50 50 50 52 53 55 55 57 57 57 58 59 60 60 61 63 63 63 63 65 67 67 68 68 68 68 70 72 72 72 72 74 74 76 76 78 80 80 82 84 85 87 87 89 89 90 92 93...

output:

4809329210

result:

ok single line: '4809329210'

Test #30:

score: 0
Accepted
time: 860ms
memory: 5464kb

input:

98767 3349493383
3 4 5 6 8 8 8 9 11 13 14 15 15 16 17 18 18 18 20 22 22 22 23 23 23 24 24 24 25 25 25 26 26 28 28 28 30 31 31 31 31 32 33 35 37 39 40 42 44 45 47 47 48 49 51 51 53 54 56 56 57 58 59 61 62 64 66 68 69 71 71 72 74 75 77 79 79 81 83 85 87 87 87 87 87 87 89 90 91 91 92 93 95 95 95 95 97 ...

output:

4094678962

result:

ok single line: '4094678962'

Test #31:

score: 0
Accepted
time: 806ms
memory: 5416kb

input:

94867 3025683990
3 3 4 5 7 9 11 13 14 14 14 15 17 17 17 17 17 18 20 22 22 24 25 25 26 28 30 30 30 31 32 34 35 37 37 37 38 38 38 39 40 41 41 43 43 44 44 45 47 47 48 49 50 52 54 54 55 57 59 61 63 65 66 66 66 67 67 67 68 68 69 69 71 71 71 71 72 74 75 77 79 81 81 81 83 83 84 85 87 88 88 90 91 92 92 92 9...

output:

3908322163

result:

ok single line: '3908322163'

Test #32:

score: 0
Accepted
time: 619ms
memory: 5336kb

input:

91659 246378163
3 3 4 4 6 7 7 9 9 9 11 12 14 15 16 16 16 18 18 20 22 22 24 24 25 25 25 26 27 27 27 27 27 27 29 31 32 33 33 33 34 34 34 35 36 37 37 38 38 38 38 38 40 41 42 43 44 46 46 48 48 48 50 51 52 54 55 57 58 60 61 63 64 66 67 69 70 72 73 74 74 74 74 74 74 74 75 76 76 76 76 78 80 80 81 81 81 81 ...

output:

1111041938

result:

ok single line: '1111041938'

Test #33:

score: 0
Accepted
time: 762ms
memory: 5628kb

input:

99470 1569644496
1 2 4 6 7 7 7 7 8 9 9 11 11 13 14 14 14 16 17 18 19 19 21 21 21 23 23 23 24 25 27 29 29 29 29 31 33 35 36 36 38 39 40 42 43 43 43 43 44 46 47 48 49 50 52 53 54 54 56 56 56 57 58 60 61 63 63 64 65 66 67 68 68 70 71 72 74 75 76 78 78 79 79 81 81 81 82 84 86 87 87 87 89 91 91 92 93 94 ...

output:

2802418185

result:

ok single line: '2802418185'

Test #34:

score: 0
Accepted
time: 621ms
memory: 5512kb

input:

94544 441795869
2 4 5 6 7 7 9 10 11 13 13 15 15 16 16 16 17 18 20 20 20 21 23 24 26 27 29 30 31 32 32 32 34 35 35 35 36 36 37 37 37 37 38 40 42 42 44 45 45 47 48 50 50 51 52 53 53 53 54 55 55 57 59 59 59 61 63 64 66 68 68 70 71 71 73 74 76 78 79 81 81 81 81 81 81 81 83 84 84 86 88 89 91 91 91 93 95 ...

output:

1482081338

result:

ok single line: '1482081338'

Test #35:

score: 0
Accepted
time: 572ms
memory: 5484kb

input:

92132 6712168296
26 43 86 151 166 171 189 190 287 311 323 331 384 430 451 478 506 595 648 708 778 782 789 881 903 930 951 985 1032 1128 1131 1156 1223 1299 1362 1417 1491 1545 1605 1663 1679 1686 1697 1760 1798 1829 1897 1964 2040 2130 2167 2170 2171 2235 2293 2338 2407 2440 2451 2514 2530 2530 2600...

output:

3413719431

result:

ok single line: '3413719431'

Test #36:

score: 0
Accepted
time: 593ms
memory: 5432kb

input:

91775 6146936725
53 70 150 200 214 229 275 329 420 445 524 601 618 649 676 731 811 875 903 956 977 1012 1031 1099 1165 1194 1233 1293 1372 1390 1464 1504 1507 1542 1602 1643 1685 1769 1773 1800 1891 1949 1967 2042 2108 2145 2198 2234 2304 2400 2488 2564 2631 2727 2758 2797 2831 2871 2912 3011 3012 3...

output:

3121995868

result:

ok single line: '3121995868'

Test #37:

score: 0
Accepted
time: 616ms
memory: 5500kb

input:

98065 1361059647
2 92 94 118 123 153 242 307 329 402 478 500 549 643 701 719 774 775 832 864 921 1006 1070 1126 1128 1213 1230 1328 1385 1451 1515 1609 1617 1623 1698 1698 1768 1836 1882 1952 2015 2109 2141 2172 2228 2244 2284 2295 2374 2447 2500 2587 2626 2692 2694 2761 2765 2784 2799 2835 2880 292...

output:

731620721

result:

ok single line: '731620721'

Test #38:

score: 0
Accepted
time: 618ms
memory: 5432kb

input:

97972 2822108786
5 32 65 161 179 180 261 315 350 442 523 604 609 692 791 812 875 917 1001 1039 1082 1177 1195 1288 1317 1415 1499 1565 1573 1642 1661 1715 1803 1819 1828 1923 2002 2024 2101 2165 2215 2283 2334 2391 2466 2472 2476 2551 2561 2616 2627 2642 2735 2772 2867 2892 2913 3005 3044 3084 3102 ...

output:

1464498579

result:

ok single line: '1464498579'

Test #39:

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

input:

100000 9999999999
100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 10...

output:

9999900000

result:

ok single line: '9999900000'

Test #40:

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

input:

98412 6566910933
100000 99999 99997 99997 99996 99995 99993 99992 99991 99990 99988 99987 99987 99987 99985 99984 99982 99980 99978 99978 99977 99977 99977 99977 99977 99975 99974 99972 99970 99970 99968 99968 99967 99966 99964 99964 99963 99961 99959 99958 99956 99954 99953 99951 99951 99949 99949 ...

output:

4913318740

result:

ok single line: '4913318740'

Test #41:

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

input:

97058 2418426525
99999 99997 99997 99997 99997 99996 99995 99993 99991 99990 99989 99989 99988 99986 99984 99983 99981 99981 99981 99980 99978 99977 99976 99975 99973 99972 99970 99970 99968 99966 99966 99965 99963 99963 99962 99961 99960 99959 99957 99955 99953 99953 99953 99951 99949 99947 99945 9...

output:

1399481571

result:

ok single line: '1399481571'

Test #42:

score: 0
Accepted
time: 19ms
memory: 5468kb

input:

97272 2041069965
99998 99996 99994 99992 99990 99988 99987 99985 99985 99985 99983 99983 99982 99981 99980 99980 99979 99978 99976 99974 99973 99973 99971 99971 99971 99969 99968 99966 99964 99964 99963 99963 99962 99961 99960 99958 99958 99958 99958 99956 99954 99954 99954 99953 99951 99951 99949 9...

output:

1154011581

result:

ok single line: '1154011581'

Test #43:

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

input:

98139 4522230740
99999 99997 99995 99994 99994 99993 99993 99991 99989 99989 99988 99988 99988 99988 99987 99986 99985 99983 99983 99983 99983 99981 99979 99978 99978 99976 99975 99974 99972 99970 99970 99968 99966 99964 99964 99964 99962 99962 99960 99958 99957 99956 99954 99954 99954 99953 99951 9...

output:

3445441318

result:

ok single line: '3445441318'

Test #44:

score: 0
Accepted
time: 23ms
memory: 5388kb

input:

91314 3856836957
99998 99996 99995 99993 99993 99992 99990 99990 99989 99988 99988 99988 99988 99987 99986 99984 99982 99980 99979 99979 99979 99977 99975 99975 99975 99973 99972 99972 99970 99970 99969 99967 99967 99965 99963 99962 99962 99961 99959 99959 99959 99957 99956 99955 99953 99952 99950 9...

output:

2607599414

result:

ok single line: '2607599414'

Test #45:

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

input:

90702 966026669
100000 99998 99997 99995 99993 99992 99992 99990 99990 99989 99989 99987 99986 99984 99982 99981 99979 99977 99975 99973 99972 99970 99970 99969 99968 99966 99964 99964 99964 99963 99963 99963 99963 99963 99962 99962 99960 99960 99959 99957 99957 99955 99955 99954 99954 99952 99952 9...

output:

507545046

result:

ok single line: '507545046'

Test #46:

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

input:

94466 25910824
99999 99999 99999 99998 99997 99997 99996 99995 99995 99994 99992 99990 99990 99988 99987 99985 99985 99985 99983 99983 99981 99980 99979 99979 99977 99975 99975 99974 99973 99971 99969 99967 99967 99965 99965 99964 99964 99963 99963 99963 99961 99961 99959 99958 99956 99956 99955 999...

output:

12924345

result:

ok single line: '12924345'

Test #47:

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

input:

91834 1036481443
99999 99998 99997 99996 99995 99993 99993 99993 99991 99991 99990 99988 99986 99985 99984 99983 99983 99983 99982 99981 99979 99978 99978 99978 99976 99974 99972 99971 99970 99970 99969 99967 99965 99964 99962 99961 99960 99958 99958 99957 99956 99956 99956 99955 99953 99951 99949 9...

output:

545442027

result:

ok single line: '545442027'

Test #48:

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

input:

93319 89057845
99993 99930 99843 99828 99772 99759 99659 99581 99519 99517 99447 99444 99439 99340 99324 99255 99221 99144 99102 99064 99035 99022 98937 98851 98804 98747 98703 98637 98613 98553 98502 98452 98377 98286 98284 98212 98208 98118 98056 97986 97947 97889 97808 97806 97710 97665 97582 975...

output:

67884435

result:

ok single line: '67884435'

Test #49:

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

input:

93260 64780557
99931 99832 99794 99707 99703 99627 99541 99518 99434 99417 99398 99392 99340 99312 99297 99206 99164 99093 99022 98927 98849 98810 98766 98702 98678 98629 98592 98515 98489 98393 98369 98272 98185 98109 98060 98058 97999 97974 97974 97897 97826 97731 97669 97640 97602 97599 97520 975...

output:

40982514

result:

ok single line: '40982514'

Test #50:

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

input:

7 15
14 10 7 2 1 3 8
1 1 100 100 1 1 1

output:

200

result:

ok single line: '200'

Test #51:

score: 0
Accepted
time: 23ms
memory: 5352kb

input:

93035 35575045
99952 99917 99851 99823 99736 99715 99657 99607 99568 99509 99474 99438 99438 99392 99323 99244 99152 99145 99056 98964 98941 98866 98815 98721 98638 98583 98529 98435 98342 98301 98272 98261 98197 98175 98165 98066 98046 97948 97882 97801 97794 97724 97634 97598 97515 97416 97328 973...

output:

24908128

result:

ok single line: '24908128'

Test #52:

score: 0
Accepted
time: 19ms
memory: 5380kb

input:

94641 30807941
99961 99896 99892 99814 99742 99677 99605 99563 99539 99495 99470 99414 99405 99333 99246 99187 99111 99033 98947 98888 98882 98835 98767 98668 98645 98603 98560 98555 98495 98459 98437 98340 98307 98218 98181 98177 98127 98090 98008 97935 97875 97837 97817 97801 97726 97680 97627 976...

output:

18487195

result:

ok single line: '18487195'

Test #53:

score: -100
Time Limit Exceeded

input:

95052 5644013666
26613 76878 47382 88032 44503 79589 28024 71966 26342 66071 39253 82129 10635 50444 910 74596 18104 80787 28619 77957 47337 87267 28258 79289 6722 91251 40083 63597 17233 82229 22896 54101 2457 67064 34713 63400 21492 78073 456 86947 1034 66378 22090 65304 35372 64942 40104 54045 36...

output:


result: