#T416. 讨厌的小数点

讨厌的小数点

Description

Little Tu has always disliked decimal points—they give him a headache at first sight. Unfortunately, Little Ya gave him a problem to solve: Given a decimal number x, can you determine what digit is at the nth position after the decimal point? (1 ≤ n ≤ 6) Upon seeing this problem, Little Tu immediately got a headache and fainted. Can you help him out?

Input Format

First, input an integer t, indicating the number of test cases, followed by t lines:

Each line contains a decimal number (the input is guaranteed to be in the form a.b, and for simplicity, there are no repeating decimals),

followed by an integer n, representing the nth digit after the decimal point.

Output Format

Output the digit at the nth position after the decimal point.

```input1 3 1.234 1 2.345 2 3.456 3 ``` ```output1 2 4 6 ``` ```markdown ## Source

CodesOnline


The translation maintains the original markdown heading format (`##`) and the plain text "CodesOnline" as is, since it appears to be a proper name or brand that doesn't require translation. The structure and formatting are preserved exactly as in the source.