#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include typedef long long ll; using namespace std; #define debug(x) cerr << #x << " = " << (x) << endl; #define mod 1000000007 //1e9+7(prime number) #define INF 1000000000 //1e9 #define LLINF 2000000000000000000LL //2e18 #define SIZE 100010 int n,m,a[SIZE]; bool check(int p){ int a2[SIZE]; int t = 0; for(int i=1;i=0;i--){ while(q < i && a2[i] + a2[q] <= a[0] + a[p]) q++; if(q == i) break; q++; ee++; } return m > ee; } int main(){ scanf("%d%d",&n,&m); for(int i=0;i