Nth digit of pi
Submissions: 1546   Accuracy:

3.15%

  Difficulty: Hard   Marks: 8


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
Author: pra1nay7_313


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



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


to report an issue on this page.