CT28008

Dev's lanterns Reckoning

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Caravans arrive at the trading post of Goldmeadow with crates of lanterns, and Dev the accountant must account for every last one. 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 <= 414; -100 <= a[i] <= 1000000000; answers fit a signed 64-bit integer.

Example 1:

Input: 19 2635 5539 3695 954 8316 9209 9477 837 1579 7130 4366 7480 379 5502 6783 7685 7999 8202 6659
Output: 736088064

Example 2:

Input: 149 8128 7536 5514 2198 2545 4581 408 959 7057 1797 5317 9708 7695 3332 5657 7948 2622 3393 1983 3102 8844 139 1481 7385 6010 92 3080 3120 230 7041 7162 519 5911 3623 344 6844 3936 7223 8724 9785 2278 1830 896 5903 2999 7330 7066 2802 3238 4452 3338 1851 4599 2118 8094 9549 9052 8664 8440 2713 9423 3122 5976 6186 3515 3573 4594 4207 3597 6597 843 3540 1954 5703 6332 821 2218 783 5152 2505 9950 6057 7113 4986 6122 1005 5244 5037 9013 9370 2118 731 3046 3751 4540 1178 8438 6850 2989 8624 5558 3104 2992 454 6110 5477 5996 988 9298 7182 -53 9387 2060 8 9915 7167 -3 9689 9949 3093 602 8028 2591 7649 7975 110 613 3806 4818 1189 3966 9478 5311 9958 6027 2972 6513 7737 8316 6710 3422 1433 1756 7708 9325 3182 2845 5042 91
Output: 4629083114

Example 3:

Input: 84 6704 835 7413 3201 8 6997 2598 6315 1762 5474 9456 8247 6750 2203 1781 7635 935 2891 9600 5742 6608 5789 1262 3570 3372 2407 6331 7381 1651 2023 5106 8287 3053 6346 1259 4120 6628 4099 8508 1069 2439 8489 8080 2030 757 2573 9980 7226 6933 3903 8324 7937 2232 2056 7328 3159 2599 5139 6934 2607 2065 1057 5015 5429 8070 6042 5933 2256 1344 2219 9241 2342 9100 8698 3105 9140 674 334 2750 6173 8639 2503 6914 7759
Output: 2599648237

Constraints:

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

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