All submissions for this problem are available.
Rounak and Sanchit have reached the finals of Brick Up and they are supposed to play a game. The objective of the game is to paint all the bricks with their color. There are n bricks placed linearly. The bricks belonging to Rounak are colored red (R) and bricks belonging to Sanchit are colored green (G). Each player plays alternatively and selects a brick owned by the opponent. He now colours all the adjacent bricks having the opponent’s colour with their colour. The player who has all the bricks coloured with their color is declared as the winner. Rounak plays first. Assuming both Rounak and Sanchit play optimally, who will win the finale?
The first line contains the number of test cases T followed by 2T lines, 2 lines per test case. The first line of each test case contains N, the number of bricks. The second line contains a string of length N consisting of only ‘R’ and ‘G’.
Output T lines, one per test case. For each test case, output "Rounak" if Rounak wins the game, and "Sanchit" if Sanchit wins the game(without quotes).
- 1 ≤ T ≤ 100
- 1 ≤ N ≤ 10^5
Input: 2 3 GGG 5 RGGGR Output: Sanchit Rounak
Example case 1.All bricks are already colored green.
Example case 2.In his first chance, Rounak selects any of the brick colored green and changes all the adjacent bricks to red. This makes all the bricks red.
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||ADA, ASM, BASH, BF, C, C99 strict, CAML, CLOJ, CLPS, CPP 4.3.2, CPP 6.3, CPP14, CS2, D, ERL, FORT, FS, GO, HASK, ICK, ICON, JAVA, JS, LISP clisp, LISP sbcl, LUA, NEM, NICE, NODEJS, PAS fpc, PAS gpc, PERL, PERL6, PHP, PIKE, PRLG, PYTH, PYTH 3.5, RUBY, SCALA, SCM guile, SCM qobi, ST, TCL, TEXT, WSPC|
Fetching successful submissions
If you are still having problems, see a sample solution here.