CF392A.Blocked Points

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Imagine you have an infinite 2D plane with Cartesian coordinate system. Some of the integral points are blocked, and others are not. Two integral points AA and BB on the plane are 4-connected if and only if:

  • the Euclidean distance between AA and BB is one unit and neither AA nor BB is blocked;
  • or there is some integral point CC , such that AA is 4-connected with CC , and CC is 4-connected with BB .

Let's assume that the plane doesn't contain blocked points. Consider all the integral points of the plane whose Euclidean distance from the origin is no more than nn , we'll name these points special. Chubby Yang wants to get the following property: no special point is 4-connected to some non-special point. To get the property she can pick some integral points of the plane and make them blocked. What is the minimum number of points she needs to pick?

输入格式

The first line contains an integer nn (0<=n<=4107)(0<=n<=4·10^{7}) .

输出格式

Print a single integer — the minimum number of points that should be blocked.

输入输出样例

  • 输入#1

    1
    

    输出#1

    4
    
  • 输入#2

    2
    

    输出#2

    8
    
  • 输入#3

    3
    

    输出#3

    16
    
首页