#include <cstring>
#include<cstdio>
#include<algorithm>
#include <cstdlib>
#include <iostream>
using namespace std;
const int maxn = 110000;
int total[maxn],disto[maxn],w[maxn],C,n,x[maxn],y[maxn],d[maxn];
int q[maxn];
int func(int j){
return d[j] - total[j+1] + disto[j+1];
}
int main()
{
int T,kase;
scanf("%d",&T);
while(T--){
if(kase++) printf("\n");
scanf("%d %d",&C,&n);
w[0]=total[0]=disto[0]=x[0]=y[0]=0;
......
阅读全文