#include int main() { int n; std::cin >> n; int k; std::cin >> k; int maxN = 0; int minN = 1001; for(int i = 0; i < n; i++) { int t; std::cin >> t; maxN = std::max(maxN, t); minN = std::min(minN, t); } std::cout << maxN - minN << std::endl; }