#include using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); int N, K; cin >> N >> K; vector vc(N); for( auto&& x : vc ) { cin >> x; } auto res = minmax_element( vc.begin(), vc.end() ); //<----- NOT """std::minmax""" !!!!!!!!!!!!!!!!! cout << *res.second - *res.first << endl; return 0; }