#include #include #include #include using namespace std; int N; vectortb[2][2500]; main() { scanf("%d",&N); vectorA(N); for(int i=0;iL(N/K),R(N/K); vectora=A; if(K%2) { for(int i=0;i+K<=N;i+=K)sort(a.begin()+i,a.begin()+i+K); } else { for(int i=0;i+K<=N;i+=K) { int l=0,r=K/2; for(int c=0;cL; priority_queue,greater >R; for(int i=0;iL; priority_queue,greater >R; for(int i=0;i