CT24418

Tomas's Topaz parcels

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Tomas inherited the exchange at the alabaster quarry of Whitestone along with its curious bookkeeping system for parcels. Time to make sense of it. 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 <= 731; 0 <= a[i] <= 1000000000; answers fit a signed 64-bit integer.

Example 1:

Input: 271 7158 1811 9400 8655 2040 5966 6635 8402 6360 2027 9998 7406 1036 3816 4851 7242 5471 1083 9832 7329 990 6288 9179 2856 7270 7684 9825 5207 8345 283 2246 3965 5127 4725 3052 1367 5949 4007 7917 722 8643 5787 3926 9397 1861 2326 8492 8230 8745 9961 8329 7034 5505 7676 7651 4648 9862 2061 2761 3108 9268 9426 9060 8894 6440 1595 8381 7635 798 7549 6274 7026 8830 6516 2058 8012 3707 565 4880 9077 9039 4942 3286 4546 9410 855 6598 8016 651 1404 2208 402 4365 9792 9073 8685 1254 2237 4481 807 4043 5455 7803 8969 9982 5425 7104 893 3140 3848 7440 8374 3745 7227 7363 9741 4797 2665 641 6641 351 6185 3438 765 9296 4433 1232 6100 7738 8203 3846 3783 5588 1953 4505 6947 8481 3141 6534 9319 464 4389 4468 7825 9373 3080 2557 5990 4109 1447 4463 6029 9229 4875 3694 3336 4035 4787 5023 1859 8857 6783 3034 6116 8532 3969 5001 50 3851 3018 254 3162 6817 7057 3479 4061 5057 1217 76 6509 2429 444 863 1185 2449 3159 9185 6455 4855 1141 4808 4686 2822 5286 6935 2125 7317 2715 9622 2444 5868 2249 5557 3943 1546 6356 5044 3603 90 5466 4846 6987 4195 6523 1567 7183 4624 3778 7349 722 8690 3132 3145 7600 7020 37 2969 4376 2236 4875 7627 66 8462 6440 8715 8902 9187 4123 4423 6008 795 202 9956 6224 361 142 2806 4913 1991 7515 9809 5637 6683 1448 8598 1568 5492 2141 636 2271 4205 4769 4042 164 8762 3392 2600 2738 3870 1777 4614
Output: 8937967628

Example 2:

Input: 246 2315 3669 5162 7612 3189 4896 965 324 5039 1109 5480 4914 2632 6533 9748 1190 6322 6515 2939 2735 5543 1114 6414 4052 8172 446 4627 3913 7136 9226 1091 9888 8603 9238 2559 3391 9602 2531 3849 3029 5218 2585 4226 3261 8285 8967 4447 2518 7511 884 1951 7673 9557 8332 392 3108 9717 7981 551 2695 7607 5693 1573 4760 1532 5157 5035 5475 2648 3054 9877 8803 6914 5034 6733 141 1033 7955 2611 854 2223 6827 3211 6888 1369 6961 438 4083 4249 3351 2957 9986 9515 5299 5799 4290 221 6005 7281 3242 8175 9027 6194 2902 5582 4338 7174 3407 8016 1602 9575 459 584 9413 7721 427 1952 7819 3248 1456 5853 9539 8673 445 2890 5171 3639 6290 961 6621 6378 8147 1666 8346 4373 6412 8639 5657 8356 6689 5107 9565 13 7167 9536 6545 7907 1693 8064 1554 2941 6902 1510 9982 4641 5527 2327 4140 8835 5017 1597 714 6620 6878 4176 3184 4837 2907 2670 924 6972 4143 2192 1754 4087 7664 6568 2466 9200 4780 9487 9784 5249 2623 3327 4865 4518 8751 2383 6577 1661 4089 4319 1136 1404 1195 6815 4935 6351 8110 3154 373 9369 6465 8535 6686 3530 9499 497 1317 8876 6015 3936 9818 9655 5021 3975 3550 9773 1171 5547 260 8104 7351 1881 864 8741 1587 2120 8278 1157 1966 3264 697 5654 1918 8536 4009 1024 6533 9586 6031 9030 6594 3611 3916
Output: 8004454384

Example 3:

Input: 35 5648 8848 6242 7592 5108 8113 9567 3454 1678 4504 9050 8627 2351 4095 4567 7720 4669 1453 9546 4814 9235 5159 6837 1641 6363 6340 2402 6185 1327 1287 9895 2361 9583 3645 5023
Output: 1345849241

Constraints:

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

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