We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
for _ in xrange(input()):
n,a,b = input(),map(int, raw_input().split()),map(int, raw_input().split())
s = [a[x] + b[x] for x in xrange(n)]
add = c = 0
for i in range(n):
index = s.index(max(s))
if c == 0: add += a[index]
if c == 1: add -= b[index]
s.pop(index)
a.pop(index)
b.pop(index)
c = 1 - c
if add > 0: print "First"
elif add < 0: print "Second"
else: print "Tie"
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Fun Game
You are viewing a single comment's thread. Return to all comments →
PYTHON:
.