CT980

Last stamps of Gardener

EasyL2 · Byte BanditAcceptance: 0.0%XP: 10

The registry keeper Gardener has been asked to inspect the delivered goods. On the desk lies a long table of stamps readings. 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 <= 73; 0 <= a[i] <= 1000000000; answers fit a signed 64-bit integer.

Example 1:

Input: 23 234348191 558131369 915118145 438361852 679662892 511840679 848052331 853377387 954937338 837010471 895798471 14661999 530817075 687301855 778415840 578664389 149761869 487050226 161049813 881313081 786518049 367630901 751176427
Output: 3338428148

Example 2:

Input: 71 896076506 236594357 140151435 366080958 516084409 508317615 948574497 659642739 736325875 776761487 45019682 437421535 35713863 421938172 378267584 674402397 716038790 819630189 650625142 633329628 779723105 624089763 346383544 838865244 937737521 726084131 873692101 21213552 450548918 754510681 577291279 895433505 814618748 793967710 151313176 258880279 12189879 263368355 978854731 369168808 948619859 182656590 127950848 923679248 547988637 690726554 24789475 885257661 134961408 924562072 152123436 823959174 717643463 32608657 108747200 3576326 562995097 777952967 424136884 550944231 894691945 65945184 412392831 973373156 75462117 696805614 590107432 529023084 47613065 890334514 583028603
Output: 16136124886

Example 3:

Input: 13 486773208 328462962 654170050 940186767 572413780 759329243 542203100 520754438 697578301 24480167 169987876 73890758 466997774
Output: 3815653946

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Last stamps of Gardener - EASY Coding Problem | CodeTikki