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:||C, CPP14, JAVA, PYTH, PYTH 3.6, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, PERL6, TEXT, PYP3, CLOJ, FS|
Fetching successful submissions
If you are still having problems, see a sample solution here.