#include //cin, cout #include //vector #include //sort,min,max #include //string #include //fixed #include //setprecision using namespace std; int main() { int N, K; cin >> N >> K; int temp = 0; int max = 1; int min = 1000; for (int i = 0; i < N; i++) { cin >> temp; if (temp > max) { max = temp; } if (temp < min) { min = temp; } } cout << max - min << endl; return 0; }