Replace pi(test cases)

Here is my code: https://ide.codingblocks.com/s/200656
Using this the custom input is passing but on submission it is showing time limit exceeded. Can you tell me what is the problem.

@Codecracaker532
hello nikhil,
use different variable for number of testcases.