J

 avatar
meda
c_cpp
2 months ago
813 B
5
Indexable
#include<bits/stdc++.h>
#define ll long long
#define endl "\n"
using namespace std;
template<class T>
void printff(vector<T>& v) {
  for (auto k : v) cout << k << " ";
  cout << endl;
}
void SOLVE() {
  int n; cin >> n;
  vector<int> a(n), b(n);
  for(auto & val : a) cin >> val;
  for(auto & val : b) cin >> val;
  int x = 0, y = 0;
  for(int i = 0; i < n; i++){
    if(a[i] == b[i]) continue;
    if(a[i] == -1) y++;
    else if(b[i] == -1) x++;
    else{
        if(a[i] < b[i]) x++;
        else y++;
    }
  }
  if(x > y) cout << "Saboya" << endl;
  else if(y > x) cout << "Alfredo" << endl;
  else cout << "Tie" << endl;  
}
int main() {
  ios_base::sync_with_stdio(false); 
  cin.tie(NULL); 
  cout.tie(NULL);
  int tc = 1; cin >> tc;
  while(tc--) SOLVE();
  return 0;
}
Leave a Comment