BETA

Difficulty Level: Hard

Submissions: 726 Accuracy:

0.69%

Nth digit of pi
     


Your task is simple enough calculate the Nth digit in the representation of Pi .

Input:

The first line of input contains an integer T denoting the number of test cases.

Each line of test case contains an integer N as described in the problem statement.

Output:

For each test case output a single line containing the Nth digit in the representation of Pi .


Constraints:

1<=T<=1000

1<=N<= 99990

Example:

Input:

3

1

2

3

Output:

3

1

4

Explanation:

Value of Pi is 3.14……

So first 3 digits are 3, 1 and 4

** For More Input/Output Examples Use 'Expected Output' option **

Contributor: Pranay Pandey

Set Default Code

					   
It is recommended to 'Compile & Test' your code before clicking 'Submit'!

Compilation/Execution Result:

Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.