No.747 Repeating Decimal N-th Digit Hard
問題文最終更新日: 2018-10-19 21:44:09
English (AI translation)
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 202
(順位表)
の他の問題:
Problem Statement
$\frac{2}{7}$ is a "repeating decimal" $0.285714285714\dots$, in which '285714' repeats forever.
Find the $N^{K}$-th digit after the decimal point of $\frac{2}{7}$.
Input
$N$ $K$
The input consists of 2 lines.
The first line contains an integer $N(1 \leq N \leq 10^{100000}$),
and the second line contains an integer $K(1 \leq K \leq 10^{100000}$),
given separated by whitespace.
Output
Output the $N^{K}$-th digit after the decimal point of $\frac{2}{7}$. Print a newline at the end.
Sample
Sample 1
Input
2 3
Output
8
Output 8, which is the $2^{3}=8$-th digit after the decimal point of $\frac{2}{7}$.
Sample 2
Input
3 2
Output
5
Sample 3
Input
9999 9999
Output
5
Sample 4
Input
314159265358979323846264338327950 28841971693993751058209749445
Output
8
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。