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