#include #define ff first #define ss second #define pb push_back using namespace std; typedef long long ll; typedef pair pii; const int mod=998244353; inline int add(int x,int y){int ret=x+y;if(ret>=mod)ret-=mod;return ret;} inline int sub(int x,int y){int ret=x-y;if(ret<0)ret+=mod;return ret;} inline int mul(int x,int y){return ((ll)x*y)%mod;} inline int step(int base,int pw){int ret=1;while(pw){if(pw&1)ret=mul(ret,base);base=mul(base,base);pw>>=1;}return ret;} inline int invv(int x){return step(x,mod-2);} const int maxn=3e5+10; int n,m; int main(){ freopen("planets.in","r",stdin); freopen("planets.out","w",stdout); scanf("%d %d",&n,&m); vectorniz; vector>events; for(int i=1;i<=n;i++){ ll a; scanf("%lld",&a); niz.pb(a); } sort(niz.begin(),niz.end()); niz.resize(m); for(int i=0;ist; ll rez=0; for(int i=0;i