CT24525

Tara and the Tempest readings

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

The council of the willow walks of Reedmarsh pays by the answer, and Tara intends to earn it. First: the full register of readings. 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 <= 497; -100 <= a[i] <= 1000000000; answers fit a signed 64-bit integer.

Example 1:

Input: 220 369183094 301586820 677592955 585191169 662706165 999310194 533400932 132191482 118652884 337177654 932622064 705983820 903719905 142768746 522742453 18532272 409040405 357408064 647406876 13143882 339845879 111504388 691074959 880657113 923932179 258363910 387335464 629885057 563886257 960237995 851630890 672308771 530051525 281650914 21224867 93967208 68268155 781473178 971902032 256790096 881104512 722955077 475055902 245187689 812698049 376147264 40943554 22195792 283122962 152983475 941717630 880333957 57069056 351770010 531966880 887756436 460499015 519365160 142324251 328504148 53357928 162579057 844061238 977942963 965729417 232037256 144238053 158209282 756673210 970189515 833065643 834019852 662652334 521316826 758580363 530714357 849483313 535110580 195008103 159121397 31875…
Output: 998561329

Example 2:

Input: 398 858529772 654493544 633724221 70833974 273247880 763873055 657503949 576153176 401103495 323436559 364731505 256301440 41693881 252591859 326304557 70961576 342438619 571242095 273496681 163453424 517754010 182315378 826863095 594460751 1412406 945304700 875085640 630963889 432490914 59064462 387322067 531427268 899435617 653195522 835433116 717339717 597960920 734415488 267643798 321676104 744198026 362719139 490826650 725096916 734096397 62054518 242397546 456043131 228551195 749409689 443654023 379954086 224274874 588918358 233948111 398357632 539483466 827954181 836484856 131807763 791539893 259471592 133052716 268745549 45915026 270061061 989570049 47102982 881174638 513099169 766528991 694300108 990471495 143619394 285937634 482131127 980568594 469973162 945706881 311094446 56639…
Output: 994283317

Example 3:

Input: 421 474630530 536671433 18824502 554611945 224802680 938864655 464489354 719788710 82481673 405633632 100635915 926232256 801988861 744612037 228042368 561038315 160969431 473942196 255771750 435885864 777231202 118748074 110857863 980769348 344787609 591604257 535190205 727582593 913582256 337001251 297164999 80338272 5076205 185108715 856806033 201835154 476092621 758912206 917583539 471298494 665622828 368442656 4602616 3747427 986541729 142836952 594430244 751493933 976066452 441668866 465795461 117234346 818706851 947358183 762696393 944253594 520110658 607457824 462638559 997408015 275696138 114020878 631345780 5349413 811942680 269544640 633517196 661026550 211965488 120106830 53031731 803651037 850012872 601251426 741116803 329626699 624709125 577769764 357614051 40190363 491319641…
Output: 996760973

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Tara and the Tempest readings - EASY Coding Problem | CodeTikki