問題一覧 > 通常問題

No.1027 U+1F4A0

レベル : / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 371
作問者 : Rho / テスター : Thistle
お気に入りにしたユーザー ProblemId : 4138 / 自分の提出
問題文最終更新日: 2020-04-17 21:39:42
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 244 (順位表) の他の問題:

Problem Statement

On a two-dimensional coordinate plane, there are a circle with center $(0,0)$ and radius $\sqrt{D_1}$, and a square with vertices $(\sqrt{D_2},0) , (0,\sqrt{D_2}) , (-\sqrt{D_2},0) , (0,-\sqrt{D_2})$.
Find the number of common points of the two figures.

Input

$D_1\ D_2$

$1 \leq D_1 , D_2 \leq 100$
All inputs are given as integers.

Output

Output the number of common points on one line.
Print a newline at the end.

Sample

Sample 1
Input
3 4
Output
8

In this case, the two figures look like this.
There are $8$ common points: $\left(±(1+\frac{1}{\sqrt{2}}),±(1-\frac{1}{\sqrt{2}})\right) , \left(±(1-\frac{1}{\sqrt{2}}),±(1+\frac{1}{\sqrt{2}})\right)$.

Sample 2
Input
3 100
Output
0

If there are no common points, output $0$.

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