// No.21 平均の差 // https://yukicoder.me/problems/no/21 // #include #include #include using namespace std; int solve(vector &numbers); int main() { int N, K; cin >> N >> K; vector numbers(N); for (auto i = 0; i < N; i++) cin >> numbers[i]; int ans = solve(numbers); cout << ans << endl; } int solve(vector &numbers) { sort(numbers.begin(), numbers.end()); return numbers[numbers.size()-1] - numbers[0]; }