#include using namespace std; //#pragma GCC optimize ("-O3") using ll = long long; #define ALL(obj) (obj).begin(),(obj).end() #define PRINT(n) cout << n << "\n"; // REP(i,n) -- 0 - n-1 ++ #define REP(i,n) for(int i=0;i<(int)n;++i) void no21(); int main() {cin.tie(0); ios::sync_with_stdio(false); no21();} /********************************/ /** yukicoder No.21 **/ /** by MoonlightSonata **/ /********************************/ void no21(){ int n, k; cin >> n >> k; vector s(n, 0); REP(i,n) cin >> s[i]; sort(ALL(s)); PRINT(s[n-1] - s[0]) }