# Practice on Toph

Participate in exhilarating programming contests, solve unique algorithm and data structure challenges and be a part of an awesome community.

Participate in exhilarating programming contests, solve unique algorithm and data structure challenges and be a part of an awesome community.

Given any circle, if you divide the circumference of that circle with its diameter, you would always find the same constant value of pi. This constant is so famous that we even have a day dedicated, just to this constant! So in this problem, we would like to tease you with the fascinating properties of pi. Let’s see if you can code and give us the first few digits of pi after the decimal places.

To help you with the job, we are providing you a C code that would print up to the first 12 digits of pi after the decimal places. But hey, you should not trust everything that you see on the internet.

```
#include <stdio.h>
#include <math.h>
int main() {
double val = 2 * acos(0.0);
printf("%.12lf\n",val);
return 0;
}
```

The first line contains an integer **T** (1 ≤ T ≤ 100), the number of testcases. Each of the following T lines will have a single integer **N** (1 ≤ N ≤ 12), the position of the decimal digit you need to print.

For each testcase, print a number on a line by itself, the digit of pi in a given position.

Input | Output |
---|---|

3 1 2 3 | 1 4 1 |

Login to submit