CT2249

Ishaan and the Square Sum

EasyL2 · Byte BanditAcceptance: 0.0%XP: 10

The council of the lily shoals of Padmore pays by the answer, and Ishaan intends to earn it. First: the full register of scrolls. 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 <= 100; -1000000 <= a[i] <= 1000000; answers fit a signed 64-bit integer.

Example 1:

Input: 24 -636812 -519831 -413005 -595784 -328003 -585265 -24881 -111488 -38625 -837059 -877206 -271223 -777439 5636 -542431 -418568 -278048 -881911 -201315 -443223 -108614 -367227 -363962 7550
Output: 5654770958646

Example 2:

Input: 27 -802009 -153740 -921274 -699725 -636 -171515 -578908 -637867 -938434 -369458 -150602 -88421 -528838 -275635 -966068 -65637 -255158 -241802 -330592 -507565 -258331 -162684 -160373 -51067 -405584 -530755 -915758
Output: 7014365970420

Example 3:

Input: 68 -593729 2142 -774190 -663233 -647178 -652396 -812446 -531656 -331584 -547959 -534392 -475993 -792416 -417731 -228115 -461712 -105762 -594130 -314766 -172212 -395128 -515383 -95791 -981630 -915963 -147044 -740780 -30316 -825938 -86820 -155319 -922973 1503 -388274 -829512 -557202 -564468 -937583 -804398 -816974 -413744 -393049 -469899 -425581 -886661 -966423 -665451 -774580 -278717 -690194 -490827 -510270 -943207 -453424 -316929 -92036 -158359 -264984 -203508 -204314 -14183 -135014 -486645 -761240 -418556 -120870 -656321 -58475
Output: 21081071462676

Constraints:

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

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