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