#include #include #include #include #include #include using namespace std; #define diff(x, y) ((x) > (y) ? ((x) - (y)) : ((y) - (x))) int main(void) { int n; int k; cin >> n >> k; vector num(n); for (int i = 0; i < n; i++) cin >> num[i]; sort(num.begin(), num.end()); cout << num[num.size() - 1] - num[0] << endl; return 0; }