問題一覧 > 通常問題

No.1842 Decimal Point

レベル : / AI推定難易度 : 850 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 119
作問者 : 👑 potato167 / テスター : tatyam ramdos
お気に入りにしたユーザー ProblemId : 6705 / 自分の提出
問題文最終更新日: 2022-04-26 04:19:11
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder contest 332 (順位表) の他の問題:

Problem Statement

Find the digit at the $C$-th decimal place of ${A}/{B}$. Answer $T$ test cases per input file.

Note

If there are multiple ways to represent a number, use the representation in which $0$ continues infinitely after the decimal point. (Added 2022/04/26)

Constraints

  • $1\leq T \leq 10^{5}$
  • $1\leq A,B,C \leq 10^{9}$
  • All inputs are integers.

Input

$T$
$case_{1}$
$case_{2}$
$\vdots$
$case_{T}$

Each test case is given in the following format.

$A \; B\; C$

Output

Output the answer. Print a newline at the end.

Sample

Sample 1
Input
5
3 2 1
1 6 7
9 2 4
123 456 789
314159265 358979323 846264338
Output
5
6
0
3
6

For test cases $1, 2, 3$:

Since ${3}/{2}=1.5$, the digit at decimal place $1$ is $5$.

Since ${1}/{6}=0.1666666...$, the digit at decimal place $7$ is $6$.

Since ${9}/{2}=4.5000$, the digit at decimal place $4$ is $0$.

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。