#include #include using namespace std; int N, K, n; int ma, mi; int main() { cin >> N >> K; for (int i = 0; i < N; i++) { cin >> n; if (i == 0) { ma = mi = n; } else { mi = min(mi, n); ma = max(ma, n); } } cout << (ma - mi) << endl; return 0; }