#include<cstdio>
#include<cstring>
#include<string>
#include<algorithm>
#include<cstdlib>
#include<iostream>
using namespace std;
class array{
public:int i;
string num;
};
bool comp(array a,array b)
{
if(a.i<b.i)return true;
else return false;
}
int main()
{ int test;
scanf("%d",&test);
array a[1000];
bool blank=false;
getchar();
while(test--){char input[100000];
gets(input);
gets(input);
char *point;
int index1=0,index2=0;
point=strtok(input, " ");
while(point!=NULL){a[index1++].i=atoi(point);
point=strtok(NULL, " ");
}
gets(input);
point=strtok(input," ");
while(point!=NULL){a[index2++].num=point;
point=strtok(NULL," ");
}
sort(a,a+index1,comp);
if(blank)cout<<endl;
blank=true;
for(int I=0;I<index1;I++)cout<<a[I].num<<endl;
}
}
কোন মন্তব্য নেই:
একটি মন্তব্য পোস্ট করুন