No.1027 U+1F4A0
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もしくは右上の雲マークをクリックしてアカウントを作成してください。
Rho