//#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; using ll=long long; using intpair=pair; using intpv=vector; using llpair=pair; using llpv=vector; using intvec=vector; using llvec=vector; using intq=queue; using llq=queue; using intmat=vector; using llmat=vector; using pairmat=vector; #define matrix(T) vector> #define PI 3.141592653589793 #define INTINF 1<<30 #define LLINF 1LL<<60 #define MPRIME 1000000007 #define MPRIME9 998244353 #define pqueue priority_queue #define pushb push_back #define fi first #define se second #define all(name) name.begin(),name.end() #define rall(name) name.rbegin(),name.rend() #define ABS(x) ( (x)>0 ? (x) : -(x) ) #define gsort(vbeg,vend) sort(vbeg,vend,greater<>()) #define init(v,size) v.resize(size); for(auto &a_: v) cin>>a_ #define out(n) cout< inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; } template inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; } template inline void outmat(T& a, int y, int x) { for(int i=0; i0) { if(ex&1) result=result*a%p; ex>>=1; a=a*a%p; } return result; } ll Fact(ll x, ll p) { //階乗 ll f=1; for(ll i=2; i<=x; i++) { f*=i; f%=p; } return f; } ll nPr(ll n, ll r) { if(n n) { return 0; } if (r > n / 2) { r = n - r; } if (n == 0) { return 0; } if (r == 0) { return 1; } if (r == 1) { return n; } double result = 1; for (double i = 1; i <= r; i++) { result *= (n - i + 1) / i; } return (ll)result; } int DigitNum(ll n) { //桁数 int digit=0; ll div=1LL; while(n/div) { digit++; div*=10; } return digit; } bool Palind(string s) { //回文判定 return s == string(s.rbegin(), s.rend()); } int N,K; intvec A; int res=0; void input() { cin>>N>>K; init(A,N); } void solve() { sort(rall(A)); res=A[0]; for(int i=1; i