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