#include #define rep(i, n) for(long long i = 0; i < n; i++) #define ALL(v) (v).begin(), (v).end() using namespace std; using lint = long long; int main() { int n, k; cin >> n >> k; vector a(n); rep(i, n) { cin >> a[i]; } cout << *max_element(ALL(a)) - *min_element(ALL(a)) << endl; }