CT23247

The Even Values Sum of the Faded parcels

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Legend says the vault under the orchid house of Bloomglass opens only for a perfect tally of parcels. Sarla means to find out. 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 <= 579; -100 <= a[i] <= 1000; answers fit a signed 64-bit integer.

Example 1:

Input: 159 777 -38 569 558 649 959 217 326 422 -8 952 753 665 100 703 501 503 701 231 316 648 14 167 517 62 512 239 344 836 440 300 244 570 51 603 -98 464 346 560 920 508 431 152 1 -22 866 423 895 489 617 -65 757 592 997 -70 657 723 631 505 896 609 622 -12 251 332 955 960 894 360 256 107 490 209 128 751 340 576 350 949 85 848 904 -15 14 751 241 700 -46 452 3 731 163 940 240 188 688 661 -68 912 595 523 191 434 614 886 309 -66 722 -23 -69 631 1 323 830 405 805 203 256 756 552 837 759 476 17 -6 411 688 923 244 67 270 621 231 873 731 231 956 657 193 472 397 310 415 976 707 541 830 575 106 907 653 269 885 18 643 363 670 220 118
Output: 34112

Example 2:

Input: 267 -2 838 766 545 262 329 820 690 686 873 806 262 297 864 546 435 566 -17 857 348 495 236 868 599 716 903 896 585 214 124 20 722 542 58 659 270 602 588 767 320 412 545 647 147 882 12 831 94 194 418 397 782 976 532 347 875 697 -13 90 744 136 170 830 973 341 90 107 985 640 171 -6 79 728 636 239 950 496 -19 132 307 551 64 36 645 869 340 358 627 309 683 670 -84 389 -58 227 172 367 966 774 448 304 394 126 760 558 887 284 777 822 550 581 85 507 82 488 398 965 902 -48 684 535 822 283 335 992 851 491 211 806 -30 228 610 74 801 232 486 520 868 813 833 -85 -100 924 392 111 61 890 503 -15 576 996 -97 56 643 760 -78 620 167 636 633 478 172 694 289 284 848 663 564 940 599 787 111 717 960 1 181 447 21 856 249 63 651 323 975 309 888 78 485 688 844 -89 266 389 551 268 259 177 648 156 93 372 484 144 35 67…
Output: 69730

Example 3:

Input: 162 933 427 523 236 573 488 640 -24 130 954 712 588 100 148 128 340 262 831 261 109 993 697 -24 167 32 784 330 125 -65 680 634 653 -51 825 792 93 492 168 -6 449 540 176 792 640 111 834 -8 -44 600 97 597 395 525 700 583 273 523 725 766 662 587 963 892 262 650 285 154 544 330 560 520 418 498 554 996 374 604 29 749 389 276 391 828 152 1000 965 254 838 188 110 98 43 294 362 -17 59 -71 311 400 623 711 805 537 933 606 125 366 655 307 455 263 582 300 614 170 695 911 573 595 878 966 407 688 134 413 -16 43 114 -4 761 383 762 500 354 23 524 183 852 767 40 342 582 -67 701 749 981 700 969 664 587 811 833 198 237 -21 285 691 791 938 729 -2 896
Output: 39146

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
The Even Values Sum of the Faded parcels - EASY Coding Problem | CodeTikki