#define REP(i, n) for(int i = 0;i < n;i++) #define REPR(i, n) for(int i = n;i >= 0;i--) #define FOR(i, m, n) for(int i = m;i < n;i++) #include #include #include using namespace std; int main() { int n,g; cin >> n; cin >> g; int w[n]; REP(i,n) cin >> w[i]; sort(w,w+n); cout << w[n-1]-w[0] << endl; return 0; }