CT28624

Viktor and the Square Sum

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

The factor Viktor has been asked to file the annual report. On the desk lies a long table of readings readings. 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 <= 786; 0 <= a[i] <= 1000000; answers fit a signed 64-bit integer.

Example 1:

Input: 198 8536 9617 1814 7817 9863 8415 8033 4716 3108 1840 211 1783 8136 8589 180 7250 8759 4562 5648 2072 8959 5920 2751 2844 8520 6250 2187 6330 7621 729 9538 6681 6591 8365 6560 9385 8659 4922 7404 8352 1233 3964 5221 6119 5090 4480 5638 8951 22 4086 3327 6479 9028 7673 830 120 3828 898 5406 680 9695 509 8512 2648 9088 8688 5869 3339 4435 5275 4252 8560 9181 7785 7701 6638 5646 3593 3690 1289 3341 2984 8404 5914 347 9353 7125 3089 9955 8081 3632 7268 4370 4282 3870 6602 1531 5771 6199 1498 161 2908 4144 136 6726 7395 1161 2136 3434 3253 5178 3220 2519 8133 2136 4597 6126 5029 8019 3234 4695 9505 4741 2051 8721 1459 4686 4175 7327 2922 6008 8906 7644 9730 2651 5339 1211 547 4895 2270 616 3442 248 7704 6848 3451 444 2597 3561 8045 1190 7465 4480 6113 3816 8441 5109 5361 901 6396 9113 4964 2926…
Output: 6584137673

Example 2:

Input: 134 2353 638 7721 3738 1962 4116 1461 6907 4922 965 8527 6263 101 8380 3508 1032 8741 266 3461 9939 6374 3845 2918 8467 1613 2453 9793 4884 6349 6360 4717 2739 5669 8480 378 6555 8721 2115 5892 1401 5152 4590 5721 5292 3818 868 7038 8221 5740 7043 6438 8490 272 5175 7690 415 9428 5580 6090 5978 4137 8103 3284 4003 7987 4998 8689 2322 5083 7463 3545 4279 6970 1839 4786 9385 5709 4719 6186 2502 1945 2602 8237 9514 4973 1492 5343 7834 8554 8571 3233 2841 8320 9264 2526 5665 4950 8847 7592 7081 7924 2514 6684 240 9446 6389 6966 835 9152 6295 3802 8088 186 7829 2411 8451 1424 9878 7144 5151 2758 2467 9051 8593 8764 887 9930 3575 8832 275 2562 2440 1882 146
Output: 4686556813

Example 3:

Input: 413 8076 3713 6030 7725 796 9960 2960 10 5058 151 1702 5941 3892 8451 9612 8093 8010 2192 2531 8901 23 9676 1176 878 5417 9184 4998 8638 3849 3078 3037 1699 5202 2055 1975 8349 88 7842 42 7795 6630 2842 4387 9477 3570 2469 4366 647 7595 4297 7322 3882 7712 7140 4708 3042 4552 6513 729 1112 7139 9952 1244 7583 5925 5437 6446 5607 8627 683 218 8607 6607 9140 6214 7697 2405 4832 8430 4416 8903 348 8688 9801 5590 523 5063 2960 8711 6482 7649 6845 391 1562 6971 998 3018 3299 3777 2633 9869 569 2496 7363 4861 4730 9872 5233 5801 8449 7145 2381 2491 6742 8703 6734 9286 6995 1530 5437 8920 2807 842 5987 4619 7035 4097 7257 8186 9237 657 1339 906 42 5867 1068 8351 8641 9524 7830 1597 985 1109 2066 5387 7360 7132 7417 8444 6726 4543 4285 3523 3114 6547 19 1584 2801 8980 6679 6030 6557 2166 1471 337 …
Output: 13624414846

Constraints:

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

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