#include #include #include int main() { size_t n, k; scanf("%zu %zu", &n, &k); std::vector a(n); for (auto& ai: a) scanf("%d", &ai); auto [it0, it1] = std::minmax_element(a.begin(), a.end()); printf("%d\n", *it1-*it0); }