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