#include int main(void) { int L=0, N=0, tmp, W[10001]={}, answer=0, f; scanf("%d", &L); scanf("%d", &N); for(int i=0; i W[q]) { tmp = W[p]; W[p] = W[q]; W[q] = tmp; } } } for(f=0; answer<=N; f+=W[answer]) { if(f