#include #include using namespace std; int main(){ int N, K, num; int minnum = 1000, maxnum = 0; cin >> N >> K; for(int i = 0; i < N; i++){ cin >> num; minnum = min(minnum, num); maxnum = max(maxnum, num); } cout << maxnum - minnum << endl; }