482

#include <iostream>
#include <sstream>
#include <map>
#include <string>
#include <cstring>
#include <queue>
using namespace std;

map<int,string> mp;

int main()
{
	int* arr;
	string db;
	int t,n;
	string str,s1,s2,s3;
	queue<int> q;
	getline(cin,str);
	stringstream ss;
	ss<<str;
	ss>>t;
	getline(cin,str);
	while(t--)
	{
		getline(cin,s1);
		getline(cin,s2);
		//q.clear();

		ss.clear();
		ss<<s1;
		int mx=0;
		while(ss>>n)
		{
			q.push(n);
			if(n>mx)
			mx=n;
		}
		mp.clear();
		ss.clear();
		ss<<s2;
		while(!q.empty())
		{
			ss>>db;
			mp[q.front()]=db;
			q.pop();
		}
		if(t)
		getline(cin,s3);

		for(int i=1;i<=mx;i++)
		{
			cout<<mp[i]<<"\n";
		}
		if(t)
		cout<<"\n";
		//cout<<double(mp[i]*1.0)<<"\n";
	}
	return 0;
}

 

Leave a Reply

Your email address will not be published. Required fields are marked *