Fruits are available at some positions on an infinite x-axis. You are given a 2D integer array fruits where fruits[i] = [position_i, amount_i] depicts amount_i fruits at the position position_i. fruits is already sorted by position_i in ascending order, and each position_i is unique.
You are also given an integer startPos and an integer k. Initially, you are at the position startPos. From any position, you can either walk to the left or right. It takes one step to move one unit on the x-axis, and you can walk at most k steps in total. For every position you reach, you harvest all the fruits at that position, and the fruits will disappear from that position.
Return the maximum total number of fruits you can harvest.
1 <= fruits.length <= 10^5fruits[i].length == 20 <= startPos, position_i <= 2 * 10^5position_i-1 < position_i for any i > 0 (0-indexed)1 <= amount_i <= 10^40 <= k <= 2 * 10^5fruits = [[2,8],[6,3],[8,6]], startPos = 5, k = 49fruits = [[0,9],[4,1],[5,7],[6,2],[7,4],[10,9]], startPos = 5, k = 414fruits = [[0,3],[6,4],[8,5]], startPos = 3, k = 20