問題一覧 > 通常問題

No.744 N-th Digit of a Repeating Decimal Easy

レベル : / AI推定難易度 : 115 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 452
作問者 : ミドリムシ / テスター : ciel
お気に入りにしたユーザー ProblemId : 1951 / 自分の提出
問題文最終更新日: 2018-10-19 17:07:47
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もしくは右上の雲マークをクリックしてアカウントを作成してください。