# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1157119 | tamzid | Stove (JOI18_stove) | C++20 | 0 ms | 0 KiB |
#include <bits/stdc++.h>
using namespace std;
void solve()
{
int n,
cin>>n>>k;
vii t(n);
for(int i=0;i<n;++i)
{
cin>>t[i];
}
if(k==1) cout<<t[n-1]-t[0];
}
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
//int t;cin>>t;while(t--)
solve();
return 0;
}