CT27259

The tickets Even Values Sum Puzzle

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Caravans arrive at the ivy courts of Vineward with crates of tickets, and Baron the cartographer must account for every last one. Task: Read n integers and print the sum of all even values. Input format: First line: n. Second line: n space-separated integers. Output format: Print the sum of even values (0 if none). Constraints: 1 <= n <= 822; 0 <= a[i] <= 1000000; answers fit a signed 64-bit integer.

Example 1:

Input: 438 313191 779422 766208 777804 17364 499926 86700 752712 93328 973062 223329 110770 240555 83673 345817 360654 813994 35485 982979 497358 742244 576776 473815 834295 39553 825936 242033 100711 593614 763746 535554 163856 172252 610053 381578 253356 576991 730140 731352 261557 26351 174618 544011 820018 798970 527608 202516 613638 532716 721369 953842 523975 731131 363011 216161 907595 899586 550065 854958 758500 599360 290482 973529 219326 579319 40258 601971 420494 787442 927254 142125 699541 696342 329260 916357 274214 780459 328255 789167 512326 170980 891156 79550 210629 969275 838287 322322 451899 732849 749875 48168 708542 456513 488887 280925 834333 260625 103854 843353 902717 863421 809289 952680 680868 790801 716774 824968 87737 158832 991050 363049 664238 872798 358401 379566 13…
Output: 111653050

Example 2:

Input: 778 814516 358808 382301 294225 557828 431619 948626 133817 827044 339017 642867 581826 998291 363706 414879 235330 957798 876194 803616 622023 122519 666364 133951 94775 301663 320141 260096 430418 207328 423396 578115 923546 446201 701019 350636 7107 905261 964119 820234 892784 311763 670166 724324 655245 378766 231446 447482 834336 247424 386423 725210 61856 485087 355035 711623 77609 776992 246602 463097 141377 89858 582350 153625 604909 972382 266392 167371 782740 542169 92383 920434 443247 215342 34279 641454 182812 416907 295725 855589 685346 380012 882267 771663 586073 870374 417898 805337 790149 449258 133431 345828 203673 570320 244595 372788 415864 210059 943354 107063 786804 937095 645320 476572 917044 504953 307494 154507 727466 290326 682686 397993 911368 575963 135709 975932…
Output: 196385936

Example 3:

Input: 336 766612 694514 860138 231217 443165 980852 813229 56097 474609 408878 975336 450509 340027 87411 295774 775667 324754 841589 274564 198812 464000 192654 912544 419248 820358 641065 821043 935816 591821 155599 172978 609475 975069 737435 18768 851941 952669 724873 628594 375220 846926 373391 835111 117637 27080 615380 106001 390335 839860 186112 906383 760179 222258 806117 995661 335981 779400 501280 40730 417123 126798 129359 318214 539130 95447 865596 799801 290332 114733 280601 783116 739545 399081 733560 414025 448056 594232 379786 896519 386513 542134 581855 663524 363172 619388 570577 164058 198307 682657 687164 573218 857468 223608 323747 512809 793324 804023 630701 51656 576213 538844 57890 901185 159347 506824 134053 303267 927326 234863 806360 861694 116442 411200 877938 244155…
Output: 82603486

Constraints:

1 <= n <= 822; 0 <= a[i] <= 1000000; answers fit a signed 64-bit integer.

Loading...
Test Cases:No test cases
No test cases available.