#include <bits/stdc++.h>
using namespace std;
struct ab{
int sum;
int a;
int b;
};
int main() {
ios::sync_with_stdio(0);
cin.tie(NULL);
int t,c=0;
cin>>t;
while(t--){
int n,tmp;
cin>>n;
ab a[1001];
for(int i=0;i<n;i++)
cin>>a[i].a;
for(int i=0;i<n;i++){
cin>>a[i].b;
a[i].sum=a[i].a+a[i].b;
}
sort(a,a+n,[](auto x,auto y){
return x.sum>y.sum;
});
int ans=0;
for(int i=0;i<n;i+=2)
ans+=a[i].a;
for(int i=1;i<n;i+=2)
ans-=a[i].b;
if(ans>0)
cout<<"First";
else if(ans<0)
cout<<"Second";
else
cout<<"Tie";
if(t)cout<<'\n';
}
return 0;
}
Comments
Post a Comment