You are viewing a single comment's thread. Return to all comments →
for _ in range(int(input())): n = int(input()) arr = [list(map(int,input().split())) for i in range(n)] tot_balls = [sum([arr[i][j] for j in range(n)]) for i in range(n)] col_balls = [sum([arr[j][i] for j in range(n)]) for i in range(n)] print('Possible' if sorted(tot_balls)==sorted(col_balls) else 'Impossible')
Seems like cookies are disabled on this browser, please enable them to open this website
Organizing Containers of Balls
You are viewing a single comment's thread. Return to all comments →