#include using namespace std; using ll=long long; #define all(v) v.begin(),v.end() #define rall(v) v.rbegin(),v.rend() template bool chmax(T &a, T b){if (a < b){a = b;return true;} else return false;} template bool chmin(T &a, T b){if (a > b){a = b;return true;} else return false;} const ll INF=1LL<<62; void Solve(){ int N,K; cin>>N>>K; vectorA(N); for(int i=0;i>A[i]; if(K==1){ ll sum=0,ans=-INF; for(int i=0;ipq; ll ans=-INF; for(int i=0;i