CT1412

Nora's Widest Spread Ledger

EasyL2 · Byte BanditAcceptance: 0.0%XP: 10

The council of the marble forum of Argentium pays by the answer, and Nora intends to earn it. First: the full register of scrolls. 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 <= 77; 0 <= a[i] <= 10; answers fit a signed 64-bit integer.

Example 1:

Input: 8 2 3 5 0 3 2 5 3
Output: 5

Example 2:

Input: 20 9 1 10 3 8 8 1 2 2 10 0 10 3 9 9 7 8 4 5 7
Output: 10

Example 3:

Input: 64 0 5 7 3 5 9 3 0 8 1 9 5 8 10 9 2 9 8 5 4 4 5 3 4 7 3 1 5 5 9 0 10 7 2 2 1 3 3 2 2 6 8 0 7 4 3 5 2 2 0 10 10 6 4 4 1 6 0 10 6 0 0 9 6
Output: 10

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.