問題一覧 > 教育的問題

No.3356 A÷B Problem

レベル : / AI推定難易度 : 312 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 小数誤差許容問題 絶対誤差が $10^{-18}$ 以下。ただし、ジャッジ側の都合で500桁未満にしてください
タグ : (AC するまで非表示) / 解いたユーザー数 63
作問者 : 👑 p-adic / テスター : 👑 hamamu
お気に入りにしたユーザー ProblemId : 12525 / 自分の提出
問題文最終更新日: 2025-11-08 13:31:40
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 488 小数誤差コンテスト (順位表) の他の問題:

Problem Statement

You are given $2$ integers $A, B$, where $B \neq 0$.

Find the rational number $\frac{A}{B}$ in decimal notation.

It is guaranteed by the constraints that $\frac{A}{B}$ has a finite decimal representation.

Input

The input is given from standard input in $1$ line in the following format:

  • Line $1$ contains $A, B$ separated by a single-byte space.
$A$ $B$

Constraints

The input satisfies the following constraints:

  • $A$ is an integer satisfying $-10^9 \leq A \leq 10^9$.
  • $B$ is an integer satisfying $-10^9 \leq B \leq 10^9$ and $B \neq 0$.
  • The rational number $\frac{A}{B}$ has a finite decimal representation.

Output

Output the rational number $\frac{A}{B}$ in decimal notation in $1$ line.

Print a newline at the end.

 

This problem accepts answers with decimal errors. Your answer is considered correct if its absolute error from the exact answer is at most $10^{-18}$.

Also, due to judge limitations, your output must be fewer than $500$ digits.

Sample 1
Input
1 1
Output
1

$\frac{A}{B} = \frac{1}{1} = 1$. Other outputs such as 1.0, 1.000000000000000001, and 0.999999999999999999 will also be judged AC.

Sample 2
Input
-1 2
Output
-0.5

$\frac{A}{B} = \frac{-1}{2} = -0.5$. Other outputs such as -0.50, -0.500000000000000001, and -0.499999999999999999 will also be judged AC.

Sample 3
Input
0 1
Output
0

$\frac{A}{B} = \frac{0}{1} = 0$. Other outputs such as 0.0, 0.000000000000000001, and -0.000000000000000001 will also be judged AC.

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