CT28985

The Misty ingots of Farhan

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Farhan found an old ledger of ingots in the brewery attic at the port of Emberfall. The margin notes pose a precise question. 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 <= 977; -100 <= a[i] <= 1000000; answers fit a signed 64-bit integer.

Example 1:

Input: 89 488767 556452 782652 242651 959560 215858 107269 374890 650265 516891 905130 907569 992883 229479 134173 787956 220766 336672 221756 527843 967517 99503 799525 415883 992736 470992 88788 929841 172653 433484 177549 771749 622754 881047 207711 624975 201905 688630 206558 322910 687783 867741 161433 20981 576305 824108 836225 372417 300702 317098 457137 491196 676799 55444 526070 465278 605610 685721 962206 285273 999381 184966 740893 702324 708283 978828 311351 898342 79959 33094 246470 701003 929606 119111 104792 234475 761605 164498 567042 100655 339635 285189 417751 47415 612931 742064 590418 290133 147434
Output: 20026134

Example 2:

Input: 192 692246 662822 777434 175406 611215 253826 992612 389436 677691 317052 382357 727210 492567 855845 270989 753753 761375 916095 496701 845648 229939 433576 959389 994701 937794 796758 285307 267508 655597 580743 802114 89212 316943 605962 813562 786960 425725 607557 96140 541568 991661 795034 5169 439721 183261 291968 986266 566832 446803 172791 502974 230806 814474 635418 845331 538631 300281 27200 612953 445258 674971 483398 262543 907175 722944 849942 955670 556459 579259 531738 387345 580289 501585 772496 150723 209374 44087 450049 31170 944772 834111 329811 979021 25451 287968 336199 716007 848260 697677 628540 208305 380542 605183 52657 633023 293887 873165 651181 438786 725654 373468 247957 437522 845896 511896 752954 678885 281653 694865 964695 482661 358188 439426 372359 847241 …
Output: 55160674

Example 3:

Input: 341 771197 3749 435552 465618 761383 267701 414086 709782 62529 313947 494195 225534 322129 846294 883 18396 806460 675113 490966 551209 424574 361311 664098 11652 483783 245693 848862 987607 319283 667357 871389 943615 332285 801751 130901 138064 676109 779591 377844 247886 744092 968446 220963 295940 192233 667794 445763 93974 2592 40231 710484 982054 772887 841550 770098 493405 782097 671238 321252 757308 288731 409560 261936 326230 16349 429724 353328 550300 965825 598648 955281 399908 584042 993469 49246 213472 82428 144467 974265 17279 316927 723665 589915 382241 533341 417399 56345 572615 15396 446124 582970 37870 440966 845983 594891 821795 413496 106343 960675 984679 505772 458285 453281 964665 180936 715076 963213 736145 544530 966702 25389 617550 16800 202840 558233 834744 82261…
Output: 79474192

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
The Misty ingots of Farhan - EASY Coding Problem | CodeTikki