CT26444

The Widest Spread of the Copper readings

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Caravans arrive at the zephyr cliffs of Galeholm with crates of readings, and Pavel the chronicler must account for every last one. 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 <= 939; 0 <= a[i] <= 1000000000; answers fit a signed 64-bit integer.

Example 1:

Input: 515 592734946 971985244 526366452 460736106 928092061 146198202 822148560 343444112 815779083 22933200 254765261 170386776 650649606 385830832 269565209 721884690 217431939 376118596 574840211 153192993 63561750 468470243 435110481 811839866 911027075 487196023 738854041 918757987 613193263 592168960 688660261 937444043 375495975 210961821 616012478 966346497 95484690 626135607 865120348 410802715 853765589 836234484 224018740 100978130 732155433 264931356 360446420 883445715 707403276 760094128 692014700 818977660 264053555 23122694 16960600 748522681 92270590 130148203 662492091 204051496 702249636 373173164 678437834 423501492 128197012 474731720 936470997 137713870 978417255 99818228 235278052 367441728 313994994 632266367 241786701 86255857 402149739 571747400 934456949 788547182 9925…
Output: 992082341

Example 2:

Input: 593 978543806 898063115 526261891 492770859 393016482 429790598 390729248 211700206 743215929 557250105 88536924 48435795 987841039 98608193 91419377 785764523 37050054 703916878 288409683 919958785 398901645 889162837 415772025 934527175 246965775 525778536 88059143 19819154 482996082 827833584 18233957 882620291 110632013 90434284 947663171 978822559 105954821 84172905 448185553 616264298 80501769 850428888 594808411 987140955 940361131 205218411 525262293 170746489 44404854 619220726 751477689 774288770 16029134 822478093 297911004 223580595 65789859 822017431 797379431 942405334 984419649 752495476 109970599 769391485 736482130 609154411 125387783 746771450 857850506 378540618 312780344 347724083 541636217 344966017 49656061 650242210 532623911 353531695 645193093 845412544 205317726 5…
Output: 998481202

Example 3:

Input: 249 214249612 51551449 704146851 432802763 690241480 74961022 490204213 418975551 76667296 651852217 495833790 241697465 216375809 333098637 411107528 460404867 425569890 589258974 525609382 615454363 846006165 798909349 243610460 339220445 406245250 378433982 432776383 999532679 273319219 341730964 388507235 289598551 959327491 384576956 899851627 809455568 338869558 3211605 176378519 704308390 5107835 373959680 178679784 478489128 775622323 595753289 454253298 477321361 519448905 709621224 331627325 102837518 765386712 809307657 534613896 609018539 454275593 558298812 642304233 559505988 366390630 601327 801442078 360196683 985180105 491058504 349018973 164795296 926543772 719554202 20139991 922308095 411390792 743310319 475031541 953246879 333221951 719646707 874148682 949339787 9084608…
Output: 998931352

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
The Widest Spread of the Copper readings - EASY Coding Problem | CodeTikki