101913: [AtCoder]ABC191 D - Circle Lattice Points

Memory Limit:256 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

Score : $400$ points

Problem Statement

We have a circle of radius $R$ centered at $(X, Y)$.
Find the number of grid points (points whose $x$- and $y$-coordinates are both integers) within or on the circle.

Constraints

  • $|X| \le 10^5$
  • $|Y| \le 10^5$
  • $0 \lt R \le 10^5$
  • Each of $X$, $Y$, and $R$ has at most four digits after the decimal point.

Input

Input is given from Standard Input in the following format:

$X$ $Y$ $R$

Output

Print the answer.


Sample Input 1

0.2 0.8 1.1

Sample Output 1

3

The circle is shown below. The grid points within or on the circle are marked red.

Figure


Sample Input 2

100 100 1

Sample Output 2

5

$X$, $Y$, and $R$ may not have decimal points. Note that we also count the grid points on the circle.


Sample Input 3

42782.4720 31949.0192 99999.99

Sample Output 3

31415920098

Input

题意翻译

### 题目描述 在二维平面上有一个以中心点 $(X,Y)$,半径 $R$ 的圆。请计算出在圆内或圆周上的格点(即 $x$ 和 $y$ 坐标均为整数的点)的个数。

加入题单

上一题 下一题 算法标签: