ource Code 

Copy
Copy
#include <bits/stdc++.h>
using namespace std;
 
int N, a, maks = 0, mins = 1100;
int main() {
    cin >> N;
    for (int i = 1; i <= N; i++)
    {
        cin >> a;
        if (a > maks)
        {
            maks = a;
        }
        if (a < mins)
        {
            mins = a;
        }
        
    }
    cout << maks - mins << endl;
    cin.get();
    return 0;