CT1472

The Widest Spread Beneath Frostgate

EasyL2 · Byte BanditAcceptance: 0.0%XP: 10

The harbor bell rings at the northern keep of Frostgate; Brevin weighs the day's stamps 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 <= 30; 0 <= a[i] <= 1000000000; answers fit a signed 64-bit integer.

Example 1:

Input: 6 525646012 527041716 133973614 415320529 852057656 955720864
Output: 821747250

Example 2:

Input: 1 17946953
Output: 0

Example 3:

Input: 17 527001781 216283229 522432753 923918230 401397530 246147818 161469736 137958179 844539550 478220748 809318838 394874836 850243584 470819414 59038781 129551186 161947504
Output: 864879449

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
The Widest Spread Beneath Frostgate - EASY Coding Problem | CodeTikki