CT21726

Rowena and the Woven scrolls

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Rowena the clerk watches over the ember mines of Cindercrag's stores of scrolls. A careful computation stands between order and chaos. 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 <= 264; -1000000 <= a[i] <= 1000000000; answers fit a signed 64-bit integer.

Example 1:

Input: 141 259715473 19461420 365325990 361142143 271197855 444817040 905951211 789391692 531066563 7369931 703328853 462731429 891056359 277915431 531699901 49662115 688232810 218305184 699046731 685518779 975152155 225481744 821232590 476628012 264770789 797240675 347454445 452748130 145452185 769139925 46238814 381895219 945991392 856356822 343716767 253986085 678624678 664951686 941270936 313600917 967486050 257608879 227834470 593389455 15284025 65987449 432536260 82724201 313525191 176385556 58978142 59558027 266007715 582560590 872712339 662740184 819692370 138990111 274767646 164272090 580109933 992170243 948075108 930856299 949911438 340048569 788025896 152946900 430417459 922750217 803910096 5898158 989035206 632065319 210263184 912753435 520913008 660040859 58735060 361997660 789052521 726264054 125069105 456038777 134800490 114369228 140679592 489699188 329048988 830537568 152236578 955106051 980566477 569796736 78775416 267837522 866526872 972934546 820024822 70921390 41005585 578954646 272128942 571910054 299984801 210584263 184948682 574626200 442684103 756002578 739234990 564740932 612936222 276939204 378414341 255037400 246690319 17655959 844063289 701956910 583333483 133292387 739925522 573312392 215028176 608295571 486080590 144302883 825764645 458939363 581117279 403339009 513939632 680365674 919874329 348390490 730536881 806277949 580045501 449979642 305142776
Output: 35758058656

Example 2:

Input: 137 399559400 480619135 484214442 702905313 619732903 425263485 542966164 207377905 875886495 171435588 843650392 222496195 771502331 886981173 124357122 73595035 38732373 273110817 603531282 719588181 403847265 714232602 542396400 699425355 859098588 677125063 638102104 625125553 379741536 689604949 895841082 147692091 236323625 784329295 578643241 230486252 161545522 337348842 776399434 922728833 944180872 382558473 237475168 365977923 575602013 902152178 133381500 88530549 888766748 71131293 858724152 679819240 488612378 365360213 394370653 187401509 484066030 210034569 581689336 163413193 532172456 270999437 358652470 88385680 363947488 643772218 817342023 382693418 811857675 466450414 229055075 366298191 26229489 956904226 359009527 243963426 966209844 213865729 564620627 347436891 622109026 546233274 121697857 906403508 478500468 658110484 500979660 40928017 321591319 399435623 517451733 315234825 487041245 411827809 226499864 55546121 739233370 38223987 540346463 302912941 160173755 297330502 246252702 866743578 377632805 776045715 179977460 936904926 256033465 293472547 62725482 379499674 507061992 976336827 464155365 983402319 965383992 886225188 433608757 870112114 70441662 260873967 509871124 28992776 821016236 369058052 75154595 69391861 945159339 316401673 346445712 561683281 242924143 504746022 726766138 887130400 714304711
Output: 35047681380

Example 3:

Input: 62 427001006 641176966 685120486 637651014 901035225 107403361 716351272 175047782 856458088 363732424 946659768 850270533 28018701 504536098 954725530 481019194 236732063 773427960 950436340 561601289 759769907 978140105 915340436 788900943 856244831 478839398 268084046 798951524 765524339 568364350 429944979 423229923 492228867 909852705 2068179 32200197 290390599 219105351 868871673 442777878 263564908 321350520 464055355 51535640 770023887 979127824 351139232 798469953 915086195 57184723 182929508 935368871 307699689 606740175 777186981 698837280 990069535 324985062 772234708 70979774 909471527 248601281
Output: 16602386016

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Rowena and the Woven scrolls - EASY Coding Problem | CodeTikki