CT28386

The Faded parcels of Nina

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

The harbor bell rings at the glass towers of Prismhaven; Nina weighs the day's parcels manifests and starts the calculations. Task: Read n integers and print the difference between the largest and smallest. Input format: First line: n. Second line: n space-separated integers. Output format: Print max(a) - min(a). Constraints: 1 <= n <= 564; -1000000 <= a[i] <= 1000000; answers fit a signed 64-bit integer.

Example 1:

Input: 309 728525 -394792 240212 769143 -800416 -647153 740807 -884193 52821 -999940 63645 755520 749222 -759513 527167 -919790 281120 407335 -369920 455475 -538466 576175 -808421 257199 265464 -721280 338240 891787 -970668 213357 590 628979 -493334 -817473 -188311 260569 -503224 -624879 -219929 599266 43999 -526295 -143115 -422675 -327972 -998183 990108 -622802 724187 965481 -295354 827574 -659051 165428 -240016 717263 542443 210409 -911590 310197 600447 -954587 16712 371892 -806852 535952 -134635 306732 -761973 310663 -986747 92315 -528603 -272063 -95641 -593004 312814 -981233 -450252 125701 -77736 829420 -832083 87394 57770 668521 -482892 187855 627986 798242 -967781 824205 843268 -648737 -832200 -367262 767876 -541547 -476273 310093 638278 194986 425127 -966548 114314 36940 -894046 -980848 51…
Output: 1993507

Example 2:

Input: 100 -418987 -60833 -869889 755606 -309376 -677760 -752406 -353481 872060 477205 902532 419840 802198 -970074 809990 -854908 -981997 -650287 -405207 143563 -856819 754258 137979 590743 151217 -51948 -202008 422913 -304824 -650693 774752 889678 -995032 426721 -115156 629122 -633430 333358 -262008 -506821 707295 -64904 915602 596663 152977 746399 -398893 -296674 197180 -31258 289272 -210125 -314086 -651714 349911 165347 -329632 -921721 -507038 206878 -167676 308529 288512 -524894 757798 147367 549308 530474 668700 -734502 -612324 722988 -982446 -59518 -361851 323917 225147 215871 -252382 -749755 -58694 539865 988225 501650 235928 579580 -818061 536824 -816100 -481638 237353 -538931 468323 -59391 225760 -767621 253810 -464758 491889 605148
Output: 1983257

Example 3:

Input: 506 -101208 998757 423049 579854 682691 -83781 6872 -535056 -889238 -120782 358930 327373 -941280 697033 -339657 277257 980424 852582 -774943 -839946 -491816 642743 -611294 -174015 754076 297550 -165283 444048 60585 -929262 502708 -460252 495707 533340 561263 91821 25220 -310480 -461078 -966976 -561525 -389307 531850 171922 1115 -222667 757376 -1899 -195667 278020 -793785 -137577 -809556 -30481 264976 -859070 -862876 -170189 391001 732718 683661 272707 -959843 -906910 662614 -782073 248790 897812 -189332 -932834 630457 -993656 -983320 -772171 -538297 825434 41514 715918 330705 -570971 -493203 -861948 -711618 -552024 214213 -584644 -754446 553940 -382820 451812 39262 -914677 -540172 616586 527459 879225 -592242 -857523 -343930 900830 244893 406255 738656 -212062 691045 -874722 -939074 39728…
Output: 1999405

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
The Faded parcels of Nina - EASY Coding Problem | CodeTikki