CT25103

Miller and the Secret parcels

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Deep in the monsoon port of Rainhaven, Miller studies rows of parcels entries. One clean number will settle the guild's oldest argument. 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 <= 318; -100 <= a[i] <= 1000000000; answers fit a signed 64-bit integer.

Example 1:

Input: 151 558722842 731264539 705438668 205139528 174631247 827525279 673910826 747581870 950349150 944474125 9138596 289085285 22656975 246541045 175879414 880491681 850883262 610453868 759158979 797377967 104749307 842212646 583991749 750812882 426016453 719689425 972626248 204555530 872788665 656703943 653053083 294233847 422766003 550745310 919367393 514718320 943892943 314182373 949003752 153630909 891798128 824375753 278830304 607429795 209263064 571153543 997469445 952820721 638432511 490279193 212126181 385703273 936445528 623841079 576703974 87091226 736930945 33386482 261146072 89167479 688554690 200038077 442722676 625198 827887358 210419603 281625169 398159565 643610044 186808895 138461844 61640440 477884233 505733431 26645109 762126431 776879443 592422355 770790911 97573673 73896364…
Output: 996844247

Example 2:

Input: 242 855394698 694147494 136679392 162897383 296050416 135724637 209890973 268728004 905443585 395536195 614369348 585331229 428345777 581199752 413067461 453248976 26641962 727712565 785199282 289261152 642759292 829305199 354909002 476696715 997951458 473352162 372651352 754723418 374906531 105838937 393463555 789132798 677160069 7729390 551025510 702630886 374030456 242843284 745294069 776977090 651783768 626454990 826396305 847819 880014801 462181076 682937951 940106430 237890788 778329012 944192755 685853171 452337805 49329114 996370401 213949190 462946517 94519916 686345699 473809715 126911411 74992339 800640830 29805471 815230458 835805260 27629210 870440753 992421086 956820769 385232971 811510297 5401031 798463402 350791179 313088735 49691551 309423099 577632652 701882375 484424921 …
Output: 997103639

Example 3:

Input: 135 334778702 383668960 533371457 294431798 185510734 286873004 878838541 278187687 91238076 294945611 268828963 525714994 610527891 531622939 805428250 414612351 642422905 272342523 507370113 431665405 43349934 171675440 944214242 156795626 450659810 430923622 465604772 958353498 523061804 989535516 891516987 831601888 613053273 739787270 799546877 764941596 431450316 64658492 941018735 124219569 797457377 738465214 545063686 131950546 129324256 842227856 498430090 636193975 247890721 564224261 523224061 608165398 646308225 966580884 567829757 436049204 157091614 775930928 583201037 866384238 457243733 766432271 404067781 920671428 745036639 708456681 431406939 825028890 156815978 857706362 128237422 159075355 634735534 376258683 842473658 309422221 762579239 548112919 92094985 583069530 …
Output: 988306110

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Miller and the Secret parcels - EASY Coding Problem | CodeTikki