I am getting correct output on compiler but here one of the test case says run-error , can you point out where I am going wrong ? Here is the link of my code https://ide.codingblocks.com/s/141377
Ultra-Fast-Mathematicians
Hi Abhishek, the problem with your code is that you are taking an extra line of input for every test case. Try taking the statement sc.nextLine() out of the while loop right after the statement T = nextInt().
Hope that helps.