CT25190

The Even Values Sum at Petalbrook

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

The harbor bell rings at the garden city of Petalbrook; Jaya weighs the day's crates manifests and starts the calculations. 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 <= 252; -100 <= a[i] <= 1000000000; answers fit a signed 64-bit integer.

Example 1:

Input: 6 164303334 894421701 95061244 251287901 850346350 945175473
Output: 1109710928

Example 2:

Input: 58 896876126 679031806 58499264 174549623 661488598 546977219 93332712 238034479 594828895 608720824 369482441 645078898 68162340 93597147 764340512 457940615 709111448 854862433 825471316 289121685 651162387 699699835 46680374 274916522 574392670 851210799 566897832 258947316 370071189 498292629 898348798 27410284 86862806 429446003 118723554 110434146 16163227 755260368 735516264 572344739 920621601 320687175 253122396 305464043 537569761 534756232 75519421 490867492 345226114 344037621 581317905 239893953 666505907 803689839 674989489 433153145 148990508 677029852
Output: 12914497372

Example 3:

Input: 25 192088810 990493911 872336967 682622987 271711453 949795269 863406133 851305420 336737323 24506781 375811300 108734879 191534346 639675866 912777837 600093338 130495595 411221686 57485957 226969004 970676571 400043308 988921367 728755022 57475052
Output: 4674973152

Constraints:

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

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