CT28461

Rosa and the Lazy crates

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

At the kelp forests of Tangledeep, Rosa records each crates in a worn leather ledger. The guild wants answers, not guesses. 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 <= 203; 0 <= a[i] <= 1000; answers fit a signed 64-bit integer.

Example 1:

Input: 25 876 227 794 446 248 247 388 355 7 341 686 583 198 544 685 97 469 555 835 729 694 140 668 424 835
Output: 7369041

Example 2:

Input: 179 314 196 860 121 137 130 259 541 611 510 778 41 592 959 83 51 349 121 939 511 308 654 238 965 127 323 752 729 611 843 422 985 92 596 474 992 349 888 228 751 171 721 777 384 528 64 234 408 730 637 310 9 60 120 107 833 98 504 891 117 864 948 367 468 477 219 570 399 722 58 174 507 753 911 882 542 395 959 483 661 668 298 440 879 290 177 562 75 666 648 78 616 710 210 372 511 586 392 22 994 282 688 564 834 158 164 913 760 996 339 277 728 705 960 225 349 604 30 456 680 565 201 775 895 925 425 235 546 220 142 896 162 281 661 502 690 592 183 90 177 572 411 292 653 990 982 399 17 388 755 683 203 987 407 677 260 251 664 6 284 412 275 804 582 852 798 443 356 803 202 257 616 318 394 304 295 652 895 212
Output: 56614728

Example 3:

Input: 77 704 681 920 700 411 54 903 66 458 216 893 418 569 35 825 294 379 28 220 136 981 199 549 345 20 845 908 514 691 766 183 503 245 932 126 392 580 969 65 779 513 700 861 638 218 157 742 104 442 368 808 179 319 714 84 303 942 363 332 477 525 773 998 132 344 76 568 898 967 168 593 25 323 684 620 337 824
Output: 25202691

Constraints:

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

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