#75

by asd

Submitted 4 years 9 months 1 day ago
Tue Feb 04 21:28:45 CST 2020
Judger: ZJS
Dataset Version: v0

171 ms / 7964 KB
Final 100
Problem: lss2.game
Language: GNU C++ 11


#1

15ms / 6916KB / Accepted
Input
1814 473184 40081
410 526 1454 1459 2396 2493 2535 2602 2706 2830 2967 3191 3315 3479 3679 3805 4132 4420 4893 4945 5445 6352 7111 7503 7529 8014 8527 8575 8590 8672 9110 9325 9537 9861 10594 10814 11183 11560 11687 12156 12395 13277 13449 13542 13584 135<...>
Output
1363999
Answer
1363999
Checker Information
"1363999"

#2

31ms / 6916KB / Accepted
Input
1460 19075 26
16 21 25 31 38 40 50 69 107 111 133 138 160 168 175 192 200 204 208 216 220 230 232 240 265 271 288 331 337 344 349 352 374 418 449 454 457 475 499 539 573 599 601 604 606 611 624 643 685 691 702 703 714 726 737 741 751 755 769 790 814 846 8<...>
Output
34699
Answer
34699
Checker Information
"34699"

#3

15ms / 6920KB / Accepted
Input
1562 78589 91
94 132 287 330 426 463 494 516 592 615 686 733 781 852 973 1002 1074 1207 1265 1276 1286 1298 1300 1302 1327 1369 1419 1425 1485 1493 1595 1672 1690 1791 1858 1863 1919 1959 1991 1999 2051 2055 2060 2062 2103 2115 2154 2205 2213 2460 2487 26<...>
Output
138911
Answer
138911
Checker Information
"138911"

#4

15ms / 6920KB / Accepted
Input
1817 241812 876
456 694 854 860 1000 1132 1178 1306 1321 1326 1353 1409 1549 1583 1881 1888 2027 2047 2294 2315 2323 2418 2432 2454 2479 2628 2884 3081 3082 3118 3171 3246 3268 3574 3606 3626 3634 3714 3856 3857 4146 4335 4688 4723 4746 4880 4994 5017 513<...>
Output
545286
Answer
545286
Checker Information
"545286"

#5

0ms / 6916KB / Accepted
Input
1137 146140 5582
299 458 492 515 556 931 1328 1462 1550 1615 1659 1867 1868 2043 2236 2399 2624 2684 2697 2911 2935 2987 3056 3059 3117 3373 3395 3478 3545 3826 4222 4502 4617 4630 4930 4973 5001 5192 5333 5422 5788 5836 5996 6248 6295 6559 6564 7087 7100<...>
Output
398744
Answer
398744
Checker Information
"398744"

#6

0ms / 6920KB / Accepted
Input
1330 60466 525
29 84 91 100 159 167 230 253 272 347 418 424 443 499 513 541 585 621 648 726 799 816 889 900 984 994 1014 1082 1084 1088 1173 1311 1314 1358 1365 1399 1404 1461 1514 1553 1562 1581 1610 1615 1668 1698 1808 1857 1875 1950 1965 1971 1988 2052<...>
Output
136098
Answer
136098
Checker Information
"136098"

#7

31ms / 6916KB / Accepted
Input
1273 167567 7542
112 125 156 680 748 1000 1004 1037 1175 1274 1358 1416 1435 1524 1749 1798 2017 2293 2359 2419 2680 3618 3833 3858 3920 4268 4309 4336 4402 4482 4916 4945 5058 5309 5366 5489 5537 5539 5575 5841 5968 6153 6431 6450 6646 6657 6670 6719 688<...>
Output
465121
Answer
465121
Checker Information
"465121"

#8

0ms / 6916KB / Accepted
Input
1414 33298 810
8 42 73 106 168 170 174 178 188 200 236 240 317 318 324 333 340 365 371 372 374 392 401 409 436 468 533 553 564 578 598 603 620 635 636 649 658 671 677 697 702 706 717 721 828 846 853 880 897 906 920 947 965 1034 1068 1073 1098 1156 1158 11<...>
Output
87076
Answer
87076
Checker Information
"87076"

#9

30ms / 6920KB / Accepted
Input
1559 638710 522
1392 1700 2292 2950 3601 3762 4738 4933 5552 5735 6047 6811 7264 7321 7570 8011 8257 8548 8557 8623 9225 9376 9541 9854 9863 9894 9944 10177 10311 10976 11317 11757 12109 12349 12663 13244 13693 13795 14526 15333 15540 15747 16380 17306 17<...>
Output
1068556
Answer
1068556
Checker Information
"1068556"

#10

0ms / 6920KB / Accepted
Input
1284 133077 4560
37 163 296 313 332 351 438 727 842 909 1122 1297 1338 1354 1372 1397 1420 1455 1500 1640 1759 1817 1962 1964 2006 2027 2074 2084 2108 2164 2283 2363 2399 2524 2553 2641 2721 2877 3006 3122 3251 3273 3533 3742 3935 4093 4164 4170 4245 4699<...>
Output
354265
Answer
354265
Checker Information
"354265"

#11

0ms / 6916KB / Accepted
Input
1882 35648 87
3 6 38 43 44 78 106 114 123 128 139 162 191 197 241 246 273 278 297 302 312 333 341 357 376 378 386 387 408 474 508 539 582 590 592 597 599 620 634 636 638 651 652 655 657 667 674 681 684 686 708 729 779 785 791 809 847 856 857 858 887 893 9<...>
Output
72063
Answer
72063
Checker Information
"72063"

#12

15ms / 6920KB / Accepted
Input
1276 59604 4
10 16 41 92 101 102 177 212 269 329 377 400 410 538 560 576 604 609 618 724 788 817 857 879 899 1028 1104 1145 1157 1165 1170 1201 1237 1388 1496 1521 1524 1541 1584 1633 1799 1801 1811 1882 1897 1999 2000 2001 2054 2057 2084 2183 2202 2277 2<...>
Output
64404
Answer
64404
Checker Information
"64404"

#13

15ms / 6920KB / Accepted
Input
1088 56497 1102
35 107 125 324 368 381 393 432 523 579 682 870 880 882 945 948 998 1040 1072 1124 1148 1150 1159 1225 1252 1253 1282 1350 1380 1407 1441 1472 1505 1595 1619 1716 1783 1796 1853 1993 2018 2027 2143 2166 2237 2260 2261 2264 2297 2299 2307 23<...>
Output
141603
Answer
141603
Checker Information
"141603"

#14

0ms / 6920KB / Accepted
Input
1980 59669 94
15 20 65 66 78 136 147 237 241 265 391 433 442 460 464 487 553 562 575 589 594 638 665 667 695 711 780 855 861 874 938 960 976 991 1019 1039 1053 1071 1077 1082 1091 1144 1152 1188 1239 1260 1275 1297 1331 1355 1389 1446 1457 1550 1568 1570 <...>
Output
113495
Answer
113495
Checker Information
"113495"

#15

15ms / 6920KB / Accepted
Input
1122 330385 4
34 407 695 1615 1675 1788 1876 1886 2443 2467 2492 2521 3441 3638 3741 4007 4189 4467 4554 4748 5078 5263 5349 5988 6117 6279 6432 6485 7151 7408 7441 7622 7874 8799 8991 9386 9454 9887 10115 10362 10606 10715 10896 11250 11431 11816 11961 1<...>
Output
334847
Answer
334847
Checker Information
"334847"

#16

15ms / 6916KB / Accepted
Input
1128 35713 1
19 27 28 87 102 151 170 183 199 234 268 278 289 295 389 396 424 433 471 545 546 551 594 653 659 714 740 753 759 797 801 812 815 830 843 847 897 940 1081 1118 1126 1247 1254 1282 1342 1358 1380 1392 1420 1444 1569 1603 1614 1652 1699 1713 1717<...>
Output
36841
Answer
36841
Checker Information
"36841"

#17

0ms / 6920KB / Accepted
Input
1187 82468 70
35 78 100 177 205 290 342 354 403 516 706 730 761 768 798 814 853 858 1033 1037 1090 1120 1220 1321 1387 1400 1603 1627 1695 1910 1962 1978 1990 2022 2058 2126 2173 2235 2242 2307 2373 2390 2497 2539 2661 2674 2764 2784 2844 3081 3154 3184 3<...>
Output
129370
Answer
129370
Checker Information
"129370"

#18

30ms / 6916KB / Accepted
Input
1473 443701 1952
311 381 390 778 1890 2314 3272 4142 4173 4335 4371 4389 4553 4642 4675 4854 5265 5350 5485 5816 7250 7331 7672 7834 8193 8349 8486 8860 9354 9432 9473 9529 10157 10285 10394 10919 11024 11427 11494 11626 12013 12020 12376 12393 12740 1274<...>
Output
1000863
Answer
1000863
Checker Information
"1000863"

#19

31ms / 6920KB / Accepted
Input
1038 11780 1
3 8 9 11 14 16 19 22 29 30 35 42 55 56 76 79 87 90 92 106 108 109 118 121 129 133 140 142 144 145 148 153 160 173 174 177 178 179 182 183 187 198 207 209 210 216 217 221 228 237 250 257 264 265 266 269 271 274 286 289 292 295 302 303 304 306 <...>
Output
12818
Answer
12818
Checker Information
"12818"

#20

15ms / 6916KB / Accepted
Input
1566 56804 1
2 32 87 151 152 157 166 212 227 228 241 247 249 298 369 383 437 443 459 462 481 651 653 691 696 728 756 775 794 810 864 902 904 922 949 966 1024 1027 1069 1075 1130 1178 1190 1232 1246 1317 1328 1368 1375 1405 1432 1461 1465 1493 1550 1554 15<...>
Output
58370
Answer
58370
Checker Information
"58370"

#1

93ms / 7964KB / Accepted
Input
100000 1000000000 1
1 24 25 49 79 108 139 147 220 221 249 264 302 316 320 363 389 391 395 409 410 432 439 455 486 489 491 501 515 516 524 529 547 550 568 603 626 633 637 648 650 668 670 675 735 751 765 768 773 779 795 836 872 894 898 925 930 947 962 1000 <...>
Output
1000100000
Answer
1000100000
Checker Information
"1000100000"

#2

109ms / 7964KB / Accepted
Input
100000 1000000000 2
29 76 97 145 184 188 224 240 258 261 276 307 313 396 400 454 456 457 461 462 477 480 487 491 508 530 549 566 580 607 623 628 680 682 701 726 748 756 766 811 819 837 859 875 886 887 953 1015 1023 1029 1044 1045 1071 1084 1138 1145 1162 <...>
Output
1000190728
Answer
1000190728
Checker Information
"1000190728"

#3

124ms / 7964KB / Accepted
Input
100000 1000000000 3
8 19 31 60 85 139 147 148 162 176 185 198 201 210 240 246 252 261 297 299 309 336 357 405 482 487 522 527 577 580 592 619 620 680 685 702 719 743 757 768 799 828 835 836 845 847 850 861 867 901 906 914 940 966 1020 1024 1027 1054 1059 <...>
Output
1000277116
Answer
1000277116
Checker Information
"1000277116"

#4

77ms / 7964KB / Accepted
Input
100000 1000000000 4
17 28 53 54 124 146 156 171 180 189 190 192 196 201 229 247 277 300 348 350 362 439 465 490 532 561 605 626 627 639 651 659 679 702 733 737 739 766 809 840 859 865 902 927 935 937 948 964 971 973 1015 1027 1039 1147 1152 1165 1225 1282<...>
Output
1000355552
Answer
1000355552
Checker Information
"1000355552"

#5

77ms / 7956KB / Accepted
Input
100000 1000000000 5
1 21 55 81 88 97 99 121 131 137 140 159 168 171 183 186 200 205 248 267 321 419 424 435 454 462 589 605 626 657 669 672 693 697 711 728 754 769 784 811 837 844 847 891 931 1035 1097 1131 1140 1143 1154 1159 1172 1180 1188 1206 1261 129<...>
Output
1000431676
Answer
1000431676
Checker Information
"1000431676"

#6

109ms / 7960KB / Accepted
Input
100000 1000000000 6
19 37 61 78 135 153 166 209 222 244 267 304 317 329 339 343 351 366 367 379 387 425 428 468 493 495 537 543 555 572 579 622 626 668 669 670 703 728 762 769 798 801 834 849 855 862 905 945 947 949 986 1006 1087 1096 1108 1144 1147 1152 <...>
Output
1000500578
Answer
1000500578
Checker Information
"1000500578"

#7

93ms / 7964KB / Accepted
Input
100000 1000000000 7
25 33 72 74 85 122 123 136 137 147 166 177 181 215 217 221 222 228 240 265 271 380 446 465 485 518 523 541 545 553 610 614 730 750 772 803 817 828 833 859 872 890 902 912 913 914 916 924 925 1007 1036 1064 1168 1208 1209 1227 1241 1254<...>
Output
1000567860
Answer
1000567860
Checker Information
"1000567860"

#8

93ms / 7960KB / Accepted
Input
100000 1000000000 8
3 4 5 30 59 79 88 104 186 189 198 211 268 300 318 320 339 349 395 447 457 479 510 542 555 591 601 624 630 644 659 733 746 764 767 772 791 803 816 822 827 855 896 901 916 931 937 956 980 990 992 1001 1011 1038 1067 1073 1080 1118 1143 1<...>
Output
1000629532
Answer
1000629532
Checker Information
"1000629532"

#9

109ms / 7960KB / Accepted
Input
100000 1000000000 9
1 70 78 90 91 140 161 165 174 183 186 210 216 317 339 347 366 409 426 433 438 462 466 482 514 527 561 586 629 639 693 731 743 746 747 772 782 783 882 886 920 940 979 982 983 1004 1058 1070 1165 1186 1187 1199 1248 1275 1276 1303 1310 1<...>
Output
1000688162
Answer
1000688162
Checker Information
"1000688162"

#10

93ms / 7964KB / Accepted
Input
100000 1000000000 10
24 42 43 74 94 107 118 122 156 158 176 285 296 303 312 320 328 332 351 366 425 497 549 588 628 630 640 641 659 661 680 707 713 728 730 738 756 768 787 788 814 833 856 874 892 938 942 952 961 1004 1006 1010 1018 1031 1068 1105 1161 116<...>
Output
1000745266
Answer
1000745266
Checker Information
"1000745266"

#11

93ms / 7960KB / Accepted
Input
100000 1000000000 20
7235 24503 30606 41775 43418 63111 72293 75675 80042 100795 108966 132473 133063 150315 152131 154827 178519 190943 196335 206501 208071 211342 238291 247600 263623 267821 268969 275143 277455 277914 278455 279931 280250 287286 289140<...>
Output
1001997160
Answer
1001997160
Checker Information
"1001997160"

#12

78ms / 7964KB / Accepted
Input
100000 1000000000 40
31407 52620 65520 73947 84056 93837 103535 105828 147372 150421 152559 154848 168433 171409 175959 194173 197695 198280 209038 243362 246205 263988 266516 279187 301249 314554 316799 324927 328077 333008 337158 337599 350296 351004 35<...>
Output
1003988042
Answer
1003988042
Checker Information
"1003988042"

#13

61ms / 7956KB / Accepted
Input
100000 1000000000 80
6963 11673 17704 32896 78564 82315 105871 107138 109451 118759 152984 178183 214123 220372 220395 226932 244603 249938 251045 254368 261374 263932 281854 282054 286225 299337 336290 375801 391572 410273 435230 486254 494841 503090 505<...>
Output
1007954808
Answer
1007954808
Checker Information
"1007954808"

#14

77ms / 7960KB / Accepted
Input
100000 1000000000 160
12389 33057 48696 52642 55122 58702 59802 66356 93110 93832 95877 104943 122569 129120 133070 137619 148885 149789 154844 156186 167192 173087 196546 199194 199966 239242 240594 245469 260762 263872 276597 279422 286663 291318 294781<...>
Output
1015814616
Answer
1015814616
Checker Information
"1015814616"

#15

46ms / 7964KB / Accepted
Input
100000 1000000000 320
1717 8100 10447 11446 15307 53915 70015 73453 82246 84214 91125 121049 131027 132357 143735 172429 177794 189583 192544 214240 215729 223627 229064 239110 254635 274900 279851 289323 316626 325509 326000 328436 329374 337325 343359 3<...>
Output
1031270402
Answer
1031270402
Checker Information
"1031270402"

#16

124ms / 7964KB / Accepted
Input
100000 1000000000 640
2048 10311 30853 36110 41542 61326 61730 83020 112148 143801 160414 162395 217011 217347 218302 257305 280736 281657 283672 286496 290615 296253 296327 310740 322843 332892 341311 349157 359754 364685 373976 391648 403525 405323 4105<...>
Output
1061027414
Answer
1061027414
Checker Information
"1061027414"

#17

93ms / 7960KB / Accepted
Input
100000 1000000000 1280
14684 40310 62016 64697 68069 68956 71839 75899 76601 109121 130334 149518 151666 152090 163182 167061 172365 173632 178663 192458 204242 217169 226530 230522 236420 243633 254675 268919 275074 276595 279265 309403 314016 327902 348<...>
Output
1116899326
Answer
1116899326
Checker Information
"1116899326"

#18

77ms / 7960KB / Accepted
Input
100000 1000000000 2560
16771 17251 21649 37212 37970 38404 41356 42486 44437 47245 56236 70018 70654 73458 85755 86761 87061 95542 108010 130637 153760 188736 194519 206227 214568 215642 225085 245128 246116 246257 248725 249361 270463 274147 278687 28305<...>
Output
1215186444
Answer
1215186444
Checker Information
"1215186444"

#19

109ms / 7960KB / Accepted
Input
100000 1000000000 5120
53088 53541 62056 90483 90580 91291 96615 112968 150845 151960 153965 165631 191754 193253 214619 215200 222697 224400 225841 235753 246378 252064 258318 291095 301527 303022 317603 317795 334965 335292 340542 366317 371692 380248 4<...>
Output
1372351916
Answer
1372351916
Checker Information
"1372351916"

#20

108ms / 7964KB / Accepted
Input
100000 1000000000 10240
1727 7715 12203 16156 29106 35704 40897 41893 65097 104853 104963 114075 118798 153616 167502 170304 192370 200930 225037 226018 227486 231982 253691 264250 275978 278649 297854 300322 306934 311777 318467 319142 336444 337912 3637<...>
Output
1588159700
Answer
1588159700
Checker Information
"1588159700"

#21

108ms / 7960KB / Accepted
Input
100000 1000000000 20480
15045 21520 35244 56765 60391 63778 66584 74051 76950 93344 93667 104835 106715 112124 117424 124099 139774 146787 151781 152434 160676 161924 168226 168922 172699 173172 180160 182116 182432 197698 203660 204837 208840 224667 2684<...>
Output
1837160766
Answer
1837160766
Checker Information
"1837160766"

#22

93ms / 7956KB / Accepted
Input
100000 1000000000 40960
6638 19998 26102 27675 39536 47404 48032 64538 69958 71174 77126 83827 93968 95366 97414 101774 114057 126709 132507 146008 152134 161464 165175 169090 174305 182988 206252 206269 221378 223778 224256 233314 235416 239276 245994 26<...>
Output
2097499870
Answer
2097499870
Checker Information
"2097499870"

#23

93ms / 7964KB / Accepted
Input
100000 1000000000 81920
3929 5914 8657 11727 18787 29508 35746 37778 87718 110025 131367 149975 176310 190046 199010 223994 237152 257428 259760 266488 287712 297395 299072 312718 330462 354258 360899 374071 390110 394747 395532 402886 403982 404445 40464<...>
Output
2343205552
Answer
2343205552
Checker Information
"2343205552"

#24

109ms / 7964KB / Accepted
Input
100000 1000000000 163840
2412 11324 11803 12058 26235 26806 32370 38574 47203 54998 55688 56803 79586 108544 111146 111179 138305 140732 141254 153120 158070 171350 179345 210308 220037 221341 236845 249627 255389 255586 255691 260223 265703 290134 299642<...>
Output
2547789584
Answer
2547789584
Checker Information
"2547789584"

#25

156ms / 7960KB / Accepted
Input
100000 1000000000 327680
3050 5951 15504 25402 68235 74174 81585 88883 110459 121309 122307 131681 142415 152797 164093 164332 176174 181085 183108 187878 199099 222474 224958 226233 279307 281989 287771 320259 332334 338392 340765 344001 357737 360964 38<...>
Output
2707179514
Answer
2707179514
Checker Information
"2707179514"

#26

93ms / 7960KB / Accepted
Input
100000 1000000000 655360
15541 20488 34744 46089 49466 70952 77418 90114 95389 96131 100202 101196 105792 144307 171688 179215 221007 233584 242264 242709 247759 251456 258477 261324 265981 271566 272278 272442 280950 297703 297897 300489 300695 304172 31<...>
Output
2817874992
Answer
2817874992
Checker Information
"2817874992"

#27

108ms / 7964KB / Accepted
Input
100000 1000000000 1310720
1779 11032 15766 17675 18350 34234 43211 51212 67949 70154 71254 81698 86843 106275 113856 114211 120195 136717 142198 148245 172746 183712 189231 192086 200121 210997 219672 225740 241086 254812 256756 281403 290631 299745 31770<...>
Output
2890061892
Answer
2890061892
Checker Information
"2890061892"

#28

124ms / 7964KB / Accepted
Input
100000 1000000000 2621440
1019 19470 26755 27830 53716 71724 84642 91551 98017 101041 108355 112078 116281 137332 162457 170885 181104 182415 187933 191280 192707 196316 213248 224441 230061 249262 301095 325710 335231 341509 345955 351107 352193 362453 3<...>
Output
2936038256
Answer
2936038256
Checker Information
"2936038256"

#29

139ms / 7960KB / Accepted
Input
100000 1000000000 5242880
1437 25425 31602 34056 40893 46712 52759 52925 65935 76029 94426 106733 111468 119433 125860 144953 147565 158603 167473 168651 173852 183267 204607 208022 213256 219765 225297 237551 241296 273435 315776 319922 333110 335152 354<...>
Output
2963107326
Answer
2963107326
Checker Information
"2963107326"

#30

124ms / 7964KB / Accepted
Input
100000 1000000000 10485760
744 17511 18730 20085 20490 34057 49384 52380 60115 64414 66569 71761 81132 106368 109505 116721 118664 122194 126827 132997 134190 140310 147213 148128 154878 158002 168418 170517 171384 171889 193364 204731 218761 268796 27996<...>
Output
2978921848
Answer
2978921848
Checker Information
"2978921848"

#31

108ms / 7964KB / Accepted
Input
100000 1000000000 20971520
9916 16851 28011 38691 39492 42880 51539 83231 99279 112065 114918 120814 132797 133353 157398 173326 186803 190009 202075 215238 240944 328214 329480 352752 352852 362837 373873 381183 387208 393787 408525 423263 433063 435697 <...>
Output
2988351492
Answer
2988351492
Checker Information
"2988351492"

#32

171ms / 7956KB / Accepted
Input
100000 1000000000 41943040
26033 30305 53702 72940 89422 131677 133311 142060 155081 194374 196178 198133 200582 207875 214698 231425 244807 274916 280729 282557 314012 314419 315286 356238 379357 383416 387519 392684 409376 426860 478588 490355 515243 51<...>
Output
2993656538
Answer
2993656538
Checker Information
"2993656538"

#33

140ms / 7964KB / Accepted
Input
100000 1000000000 83886080
10326 12230 27449 52977 68469 69254 80696 96883 97806 100218 124065 134793 138911 147725 160981 171056 174568 178803 182770 183931 184689 187209 190258 194690 212060 214107 217094 263044 272050 273905 282139 306126 308632 310829<...>
Output
2996784296
Answer
2996784296
Checker Information
"2996784296"

#34

78ms / 7964KB / Accepted
Input
100000 1000000000 111848106
15510 26452 45788 68934 71613 71814 90693 104902 125095 138377 138650 155019 156640 162165 168000 171667 173682 176965 183248 199833 212927 222339 252095 255884 257140 259241 261901 263772 272731 278444 284453 285984 287622 288<...>
Output
2997551300
Answer
2997551300
Checker Information
"2997551300"

#35

124ms / 7960KB / Accepted
Input
100000 1000000000 149130808
12497 33674 35500 56068 92056 95681 105471 108428 109787 128883 131570 132089 137467 149961 150875 157423 160958 162078 166049 212044 213367 244505 254933 274507 276235 303540 325013 327386 338842 342028 379582 386397 414785 42<...>
Output
2998131094
Answer
2998131094
Checker Information
"2998131094"

#36

124ms / 7960KB / Accepted
Input
100000 1000000000 198841077
14285 45430 57317 62286 63512 94020 116319 133457 143315 167255 178976 210075 213547 224145 226425 230589 236668 243197 271673 309603 319076 319087 348139 354127 368005 394074 396795 410240 412132 417950 427276 456041 461166 46<...>
Output
2998584658
Answer
2998584658
Checker Information
"2998584658"

#37

93ms / 7964KB / Accepted
Input
100000 1000000000 265121436
9509 10562 20528 39603 45757 46247 49000 51538 59577 89620 90981 93349 94159 110227 118661 174875 178319 182921 187037 195188 213662 214428 224867 234257 237076 260438 275265 288589 299602 307342 315962 317215 320544 325249 336<...>
Output
2998957530
Answer
2998957530
Checker Information
"2998957530"

#38

93ms / 7960KB / Accepted
Input
100000 1000000000 353495248
3999 25191 61237 62047 76758 81560 90092 103165 110886 116288 130523 133729 143365 146138 152160 164370 169473 176040 178312 190490 193519 195487 204367 230684 233270 266988 294769 305907 313619 314740 318951 322493 324548 3294<...>
Output
2999254000
Answer
2999254000
Checker Information
"2999254000"

#39

93ms / 7960KB / Accepted
Input
100000 1000000000 471326997
2783 3670 3732 32169 48500 58797 58856 62637 64057 66813 81227 81911 88440 98172 138553 149219 163352 172942 178599 194436 220874 225497 233353 246803 250783 256363 271883 273265 277319 283236 283634 285675 293734 300502 372541<...>
Output
2999389074
Answer
2999389074
Checker Information
"2999389074"

#40

93ms / 7960KB / Accepted
Input
100000 1000000000 628435996
3647 6789 6836 11593 26748 43315 51633 58719 59231 62405 80128 90285 104470 122972 130479 130691 144814 160152 193758 205763 208180 230449 231723 243332 249307 255687 259107 278080 299548 313293 314685 335394 344087 351392 3533<...>
Output
2999614186
Answer
2999614186
Checker Information
"2999614186"

#41

108ms / 7964KB / Accepted
Input
100000 1000000000 837914661
15320 18959 22839 24447 25632 28083 37799 45782 71726 72981 82883 85101 100996 121332 130108 157732 165863 169542 194219 197791 202796 227653 249781 283856 286160 289075 295667 295691 299462 306974 311483 345828 356853 361373 3<...>
Output
2999788938
Answer
2999788938
Checker Information
"2999788938"
#include <bits/stdc++.h>

#define ln                '\n'
#define all(dat)           dat.begin(), dat.end()
#define loop(i, to)        for (int i = 0; i < to; ++i)
#define cont(i, to)        for (int i = 1; i <= to; ++i)
#define circ(i, fm, to)    for (int i = fm; i <= to; ++i)
#define foreach(i, dat)    for (__typeof(dat.begin()) i = dat.begin(); i != dat.end(); ++i)

typedef long long          num;

using namespace std;

const int nsz = 1e5;
const num inf = 0x3f3f3f3f3f3f3f3f;
int n, m, a[nsz + 5];
num t, dp[nsz + 5], ans;

struct segment_tree {
	#define ls  (u << 1)
	#define rs  (u << 1 | 1)
	int fm[4 * nsz + 5];
	num mn[4 * nsz + 5], del[4 * nsz + 5];
	
	void inline down(int u) {
		if (!del[u])  return;
		mn[ls] += del[u];
		mn[rs] += del[u];
		del[ls] += del[u];
		del[rs] += del[u];
		del[u] = 0;
	}
	
	void init(int u = 1, int l = 0, int r = n) {
		if (l == r) {
			fm[u] = l;
			return;
		}
		int md = (l + r) >> 1;
		init(ls, l, md);
		init(rs, md + 1, r);
		fm[u] = fm[ls];
	}
	
	void upd(int el, int er, int val, int u = 1, int l = 0, int r = n) {
		if (l >= el && r <= er) {
			mn[u] += val;
			del[u] += val;
			return;
		}
		down(u);
		int md = (l + r) >> 1;
		if (el <= md) {
			upd(el, er, val, ls, l, md);
		}
		if (er > md) {
			upd(el, er, val, rs, md + 1, r);
		}
		fm[u] = mn[ls] < mn[rs] ? fm[ls] : fm[rs];
		mn[u] = min(mn[ls], mn[rs]);
	}
	
	pair<num, int> qry(int el, int er, int u = 1, int l = 0, int r = n) {
		if (l >= el && r <= er)  return make_pair(mn[u], fm[u]);
		down(u);
		int md = (l + r) >> 1, fm = -1;
		num mn = inf;
		pair<num, int> res;
		if (el <= md) {
			res = qry(el, er, ls, l, md);
			mn = res.first, fm = res.second;
		}
		if (er > md) {
			res = qry(el, er, rs, md + 1, r);
			fm = mn < res.first ? fm : res.second, mn = min(mn, res.first);
		}
		return make_pair(mn, fm);
	}
};
segment_tree tr;

num f(int i, int j) {
	return t - 2LL * (a[i] - a[j + 1]);
}

num calc(int i, int j) {
	return dp[j] + 3LL * a[i] - a[j] - 2LL * a[j + 1] + max(0LL, t - 2 * (a[i] - a[j + 1]));
}

int main() {
	ios::sync_with_stdio(0);
	cin >> n >> m >> t;
	cont (i, n) {
		cin >> a[i];
	}
	tr.init();
	int j = 0;
	tr.upd(0, 0, dp[0] - a[0] - 2 * a[1] + max(0LL, t - 2 * (a[0] - a[1])));
	cont (i, n) {
		for (; j < i && f(i, j) <= 0; tr.upd(j, j, -f(i - 1, j)), ++j);
		tr.upd(j, i - 1, -2 * (a[i] - a[i - 1]));
		pair<num, int> tmp = tr.qry(0, i - 1);
		int p = tmp.second;
		dp[i] = calc(i, p);
		tr.upd(i, i, dp[i] - a[i] - 2 * a[i + 1] + max(0LL, t - 2 * (a[i] - a[i + 1])));
	}
	ans = dp[n] + m - a[n];
	cout << ans << ln;
}