# include# include # include using namespace std; struct node { int pos; int d; int num; friend bool operator <(node n1,node n2) { if(n1.pos==n2.pos) return n1.d>n2.d;//仍的距離從小到大 return n1.pos>n2.pos;//位置從小到大 } }; struct node a; int main() { int t,n,i,num,sum; while(~scanf("%d",&t)) { priority_queue q; while(t--) { scanf("%d",&n); num=1; for(i=0;i