
class Solution {
public:
struct per{
int acost,bcost;
int num;
bool friend operator > (per a,per b)
{
return a.acost<b.acost;
}
}a[110];
struct per1{
int acost,bcost;
int num;
bool friend operator > (per1 a,per1 b)
{
return a.bcost<b.bcost;
}
}b[110];
int twoCitySchedCost(vector<vector<int>>& costs) {
int n=costs.size();
for (int i=0;i<n;i++)
{
a[i].acost=costs[i][0];
a[i].bcost=costs[i][1];
a[i].num=i;
b[i].acost=costs[i][0];
b[i].bcost=costs[i][1];
b[i].num=i;
}
sort(a,a+n);
sort(b,b+n);
for (int i=0;i<n;i++)
{
cout<<a[i].acost<<" "<<a[i].bcost<<endl;
}
for (int i=0;i<n;i++)
{
cout<<b[i].acost<<" "<<b[i].bcost<<endl;
}
return 1;
}
};