#include #include #define N_MAX 9 using namespace std; int main() { int N, K, n[N_MAX]; cin >> N >> K; for (int i = 0; i < N; ++i) cin >> n[i]; sort(n, n + N); cout << n[N - 1] - n[0] << endl; return 0; }