No.744 N-th Digit of a Repeating Decimal Easy
問題文最終更新日: 2018-10-19 17:07:47
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" in which '285714' repeats forever, as in $0.285714285714\dots$.
Find the $N$-th digit after the decimal point of $\frac{2}{7}$.
Input
$N$
The input consists of one line.
The first line contains an integer $N(1 \leq N \leq 10^{9}$).
Output
Output the $N$-th digit after the decimal point of $\frac{2}{7}$. Insert a newline at the end.
Sample
Sample 1
Input
4
Output
7
Output 7, which is the 4th digit after the decimal point of $\frac{2}{7}$.
Sample 2
Input
14
Output
8
Sample 3
Input
9999
Output
5
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。