CF78D.Archer's Shot
提高+/省选-
通过率:0%
时间限制:2.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
A breakthrough among computer games, "Civilization XIII", is striking in its scale and elaborate details. Let's take a closer look at one of them.
The playing area in the game is split into congruent cells that are regular hexagons. The side of each cell is equal to 1. Each unit occupies exactly one cell of the playing field. The field can be considered infinite.
Let's take a look at the battle unit called an "Archer". Each archer has a parameter "shot range". It's a positive integer that determines the radius of the circle in which the archer can hit a target. The center of the circle coincides with the center of the cell in which the archer stays. A cell is considered to be under the archer’s fire if and only if all points of this cell, including border points are located inside the circle or on its border.
The picture below shows the borders for shot ranges equal to 3, 4 and 5. The archer is depicted as A.

Find the number of cells that are under fire for some archer.
一款在电脑游戏领域取得突破性进展的作品——《文明XIII》,以其宏大的规模与精细的细节令人瞩目。让我们深入探究其中一项设定。
游戏中的游戏区域被划分为全等的正六边形格子单元,每个格子的边长为 1。每个单位恰好占据游戏区域中的一个格子。该区域可视为无限延伸。
我们来考察一种名为“弓箭手”(Archer)的战斗单位。每位弓箭手拥有一个参数——“射程”(shot range),它是一个正整数,决定了弓箭手能够命中目标的圆形区域的半径。该圆的圆心与弓箭手所处格子的中心重合。当且仅当某格子的所有点(包括边界点)均位于该圆内部或圆周上时,该格子才被视为处于弓箭手的火力覆盖范围内。
下图展示了射程分别为 3、4 和 5 时的火力覆盖边界,弓箭手以符号 A 表示。

求对于某一弓箭手而言,其火力所能覆盖的格子总数。
输入格式
The first and only line of input contains a single positive integer k — the archer's shot range (1 ≤ k ≤ 106).
输入仅有一行,包含一个正整数 k —— 弓箭手的射击距离(1 ≤ k ≤ 106)。
输出格式
Print the single number, the number of cells that are under fire.
Please do not use the %lld specificator to read or write 64-bit integers in C++. It is preferred to use the cout stream (also you may use the %I64d specificator).
输出单个数字,即处于火力覆盖下的格子数量。
在 C++ 中,请勿使用 %lld 格式说明符读取或写入 64 位整数。推荐使用 cout 流(当然也可以使用 %I64d 格式说明符)。
输入输出样例
输入#1
3
输出#1
7
输入#2
4
输出#2
13
输入#3
5
输出#3
19
输入解题思路,AI测评打分。不知道怎么写?