#include #include #define N 210000 int cas,n,m,l,t,p,ans; int a[N],b[N],tree[N],c[N]; void build(int l,int r,int p){ if (l==r) { tree[p]=1; return; } int mid=(l+r)/2; build(l,mid,p+p); build(mid+1,r,p+p+1); tree[p]=tree[p+p]+tree[p+p+1]; } int find(int l,int r,int p,int v){ if (l==r){ tree[p]=0; return(l); } int s=0; int mid=(l+r)/2; if (tree[p+p+1]<=v) s=find(l,mid,p+p,v-tree[p+p+1]); else s=find(mid+1,r,p+p+1,v); tree[p]=tree[p+p]+tree[p+p+1]; return(s); } int main(){ scanf("%d",&cas); while (cas-->0){ memset(a,0,sizeof(a)); memset(b,0,sizeof(b)); memset(tree,0,sizeof(tree)); scanf("%d",&n); for (int i=1;i<=n;++i) scanf("%d",&a[i]); for (int i=2;i<=n;++i) b[i]=a[i]-a[i-1]; build(1,n,1); for (int i=n;i>0;--i) c[i]=find(1,n,1,b[i]); for (int i=1;i