#include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; int main() { int n, k, min = 10000000, max = 0;; cin >> n >> k; for (int i = 0; i < n; i++) { int a; cin >> a; if (a < min)min = a; if (a > max)max = a; } cout << max - min << endl; return 0; }