#abc366e. E - Manhattan Multifocal Ellipse
E - Manhattan Multifocal Ellipse
Score : points
问题陈述
给定二维平面上的 个点 ,以及一个非负整数 。
找出满足 $\displaystyle \sum_{i=1}^N (|x-x_i|+|y-y_i|) \leq D$ 的整数对 的数量。
以上为大语言模型 kimi 翻译,仅供参考。
Problem Statement
You are given points on a two-dimensional plane, and a non-negative integer .
Find the number of integer pairs such that $\displaystyle \sum_{i=1}^N (|x-x_i|+|y-y_i|) \leq D$.
Constraints
- for .
- All input values are integers.
Input
The input is given from Standard Input in the following format:
Output
Print the answer.
Sample Input 1
2 3
0 0
1 0
Sample Output 1
8
The following figure visualizes the input and the answer for Sample . The blue points represent the input. The blue and red points, eight in total, satisfy the condition in the statement.
Sample Input 2
2 0
0 0
2 0
Sample Output 2
0
Sample Input 3
6 100
9 -6
10 -1
2 10
-1 7
-7 5
-1 -4
Sample Output 3
419