(RankList for this Question)
Sachin and Mohit are playing a game in which there is an array(arr) of integers(1 based indexing). Sachin picks up the integers which are at even indices and Mohit picks up the integers which are at odd indices. They both are weak in Math.
Can you help them to decide who is the winner of the game? (Winner is the one who has the maximum sum of the elements).
1 <= t <= 10
1 <= n <= 10^5
-10^5 <= arr[i] <= 10^5
The first line contains the single integer (t) — the number of test cases.
The first line of each test case contains a single integer (n) — the length of array arr
The second line contains n integers arr,arr,…,arr[n] — the array arr.
For each test case print one line i.e. the winner’s name, “Sachin” or “Mohit”. In case of a tie, print “Tie”.
2 4 6 8
2 -2 2 -2
In the first test case, the sum of elements at even indices is 12 (4+8) and that at odd indices is 8 (2+6). Hence, Sachin wins.
Log In to solve the Question