本网站所有文字及图片内容均来自网络，每周定时更新，仅供个人学习与研究，请勿用于商业用途。谢谢合作。

Given an array `points`

containing the coordinates of points on a 2D plane, sorted by the x-values, where `points[i] = [x`

such that _{i}, y_{i}]`x`

for all _{i} < x_{j}`1 <= i < j <= points.length`

. You are also given an integer `k`

.

Find the *maximum value of the equation *`y`

where _{i} + y_{j} + |x_{i} - x_{j}|`|x`

and _{i} - x_{j}| <= k`1 <= i < j <= points.length`

. It is guaranteed that there exists at least one pair of points that satisfy the constraint `|x`

._{i} - x_{j}| <= k

**Example 1:**

Input:points = [[1,3],[2,0],[5,10],[6,-10]], k = 1Output:4Explanation:The first two points satisfy the condition |x_{i}- x_{j}| <= 1 and if we calculate the equation we get 3 + 0 + |1 - 2| = 4. Third and fourth points also satisfy the condition and give a value of 10 + -10 + |5 - 6| = 1. No other pairs satisfy the condition, so we return the max of 4 and 1.

**Example 2:**

Input:points = [[0,0],[3,0],[9,2]], k = 3Output:3Explanation:Only the first two points have an absolute difference of 3 or less in the x-values, and give the value of 0 + 0 + |0 - 3| = 3.

**Constraints:**

`2 <= points.length <= 10^5`

`points[i].length == 2`

`-10^8 <= points[i][0], points[i][1] <= 10^8`

`0 <= k <= 2 * 10^8`

`points[i][0] < points[j][0]`

for all`1 <= i < j <= points.length`

`x`

form a strictly increasing sequence._{i}