300413: CF78D. Archer's Shot

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

Description

Archer's Shot

题意翻译

**题目描述:** 如下图,"$Civilization XIII$"游戏中的每一个正六边形边长都为1。有一个射箭运动员站在图中的$A$处: ![CF78DPIC](https://cdn.luogu.com.cn/upload/vjudge_pic/CF78D/4ab005c95a817122b246c2ebc315408e9138d480.png) 这个射箭运动员$A$有一个常数$k$,表示其可以射箭的长度范围。每个射箭运动员都可以射到六个顶点到自己的距离都小于等于$k$的正六边形。 **输入格式** 一行,一个常数$k$。$1 \le k \le 10^{6} $ **输出格式** 一行,表示可以射到的正六边形个数。 答案用可能需要64位整型,建议使用$cout$。

题目描述

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 $ . ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF78D/4ab005c95a817122b246c2ebc315408e9138d480.png)Find the number of cells that are under fire for some archer.

输入输出格式

输入格式


The first and only line of input contains a single positive integer $ k $ — the archer's shot range ( $ 1<=k<=10^{6} $ ).

输出格式


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).

输入输出样例

输入样例 #1

3

输出样例 #1

7

输入样例 #2

4

输出样例 #2

13

输入样例 #3

5

输出样例 #3

19

Input

题意翻译

**题目描述:** 如下图,"$Civilization XIII$"游戏中的每一个正六边形边长都为1。有一个射箭运动员站在图中的$A$处: ![CF78DPIC](https://cdn.luogu.com.cn/upload/vjudge_pic/CF78D/4ab005c95a817122b246c2ebc315408e9138d480.png) 这个射箭运动员$A$有一个常数$k$,表示其可以射箭的长度范围。每个射箭运动员都可以射到六个顶点到自己的距离都小于等于$k$的正六边形。 **输入格式** 一行,一个常数$k$。$1 \le k \le 10^{6} $ **输出格式** 一行,表示可以射到的正六边形个数。 答案用可能需要64位整型,建议使用$cout$。

加入题单

算法标签: