Computer Science, asked by saumitraverma04, 9 months ago

Write the program of the following in python/C++/java; Pls no Spam If you Don't know the answer pls don' write that. It is Diwali, and Rohan and Sanjana are stranded in their house as its raining outside. So they decide to play a game, rules of which are mentioned below: An array L is chosen containg N elements, they take turns making single move each, With Rohan making the first move. In a single move the player chooses any one of the N elements present in the array L, and adds it to his own score and removes it from the array L. As after each move size of L is reduced by 1, hence after N moves the number of elements of the array will become zero and the game ends. After the the game ends score of Rohan and Sanjana are refferedd as R and S respectively. if |R - S| is a multiple of 3, the Sanjana wins, else Rohan wins. Input Format First line contain a single integer I denoting the number of games played by Rohan and Sanjana Each game is Comprised of two lines : first containng integer N and second line contains n space-seperated integer describing array L Constraints 1≤ I ≤ 100 1 ≤ Any element of L ≤ 2000 1 ≤ N ≤ 2000 Output Format For each game played, print the name of the wiiner in a single line Sample Input 0 2 3 7 6 18 1 3 Sample Output 0 Rohan Sanjana

Answers

Answered by MSYashii666
1

Answer:

it is very big you can ask this question from Google in short

Similar questions