跳到主要内容
图灵 OJTURING / ONLINE JUDGE

#F2151. Blocked Points

    ID: 2157 传统题 2000ms 256MiB 尝试: 0 已通过: 0 难度: (无) 上传者: 标签>数学难度待定难度共享题库Codeforces英文题面题目来源题面语言

Blocked Points

题目描述

A. Blocked Points
time limit per test
2 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output

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 A and B on the plane are 4-connected if and only if:

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

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 n, 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?

Input

The first line contains an integer n (0≤n≤4·107).

Output

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

Examples
Input
1
Output
4
Input
2
Output
8
Input
3
Output
16

题目来源:fps-www.educg.net-codeforce-1-2833.xml.zip;FPS 共享题包,题包内第 1755 题。保留原作者与原赛事署名。