CT995

The Square Sum of the Hidden parcels

EasyL2 · Byte BanditAcceptance: 0.0%XP: 10

The council of the tulip beds of Bloomhaven pays by the answer, and Wade intends to earn it. First: the full register of parcels. 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 <= 52; -1000000 <= a[i] <= 1000; answers fit a signed 64-bit integer.

Example 1:

Input: 48 -737268 -343088 -899825 -121185 -101982 -301938 -80665 -463509 -902242 -30143 -846373 -133661 -586029 -278514 -938893 -912151 -392199 -13346 -50513 -753138 -852383 -254754 -332357 -416719 -681748 -386383 -909325 -193260 -677349 -676181 -165972 -621234 -131678 -17398 -8795 -180084 -190431 -742698 -557703 -826516 -62630 -277380 -465122 -989041 -803886 -48751 -926742 -392790
Output: 14668714971032

Example 2:

Input: 39 -196998 -391118 -372354 -925909 -197737 -986677 -736855 -230056 -622573 -292271 -45674 -845958 -517277 -562614 -234602 -151910 -355423 -5163 -163828 -901086 -199507 -649085 -240533 -192220 -196888 -455226 -866532 -104304 -18634 -779605 -944259 -937594 -101311 -676446 -461560 -685832 -6805 -568867 -91852
Output: 11040221446501

Example 3:

Input: 14 -78896 -620287 -381765 -543959 -127595 -702142 -681094 -993185 -883441 -123172 -61005 -882214 -539337 -300034
Output: 4750773097952

Constraints:

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

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