CT1456

Ashen tickets Square Sum

EasyL2 · Byte BanditAcceptance: 0.0%XP: 10

Before the gates of the anvil district of Hammerfall close for winter, Pavel must finish the tickets ledger - one figure at a time. Task: Read n integers and print the sum of their squares. Input format: First line: n. Second line: n space-separated integers. Output format: Print the sum of squares. Constraints: 1 <= n <= 66; 0 <= a[i] <= 1000; answers fit a signed 64-bit integer.

Example 1:

Input: 27 454 449 710 23 42 590 728 65 52 56 929 304 273 773 417 836 462 874 676 223 41 811 242 752 567 636 86
Output: 7803435

Example 2:

Input: 23 954 97 961 871 579 258 587 840 707 111 617 130 870 627 417 691 476 800 747 880 491 74 194
Output: 9247997

Example 3:

Input: 17 867 540 727 310 958 336 632 859 560 545 653 229 111 520 863 24 319
Output: 6055185

Constraints:

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

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