302068: CF392A. Blocked Points
Memory Limit:256 MB
Time Limit:2 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
Blocked Points
题意翻译
你得到了一张的 2D 无穷大网格,刚开始,每个格点都是可走的。 我们定义两个点之间是 `4联通` 的,当且仅当它们之间的**曼哈顿距离**等于它们之间沿可走格点的最短路。 我们定义一个点是特殊的当且仅当它到原点的**欧几里得距离** $\le n$。 现在,你需要标记尽可能少的点,让所有特殊点和非特殊点之间不联通。 输出至少需要加几个点。题目描述
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?输入输出格式
输入格式
The first line contains an integer $ n $ $ (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