For this Question: You are given an array A of size N consisting of integers. In one move, you can select any element of the array, and either increase or decrease it by one. In other words, in one move you select an index i (1 ≤ i ≤ N) and replace A<sub>i</sub> by either A<sub>i</sub>-1 or A<sub>i</sub>+1.

For example, if A = [1, 4, -2, 0, 1], if you select i = 3 and decide to increase it, after this move A = [1, 4, -1, 0, 1]. Lets say now you select i = 1 and decrease it, after this move A = [0, 4, -1, 0, 1].

You are also given an integer K in the input. Your task is to find the minimum number of moves you must perform, so that there exist two indices i, j, such that 1 ≤ i ≤ j ≤ N and A[i] + A[i+1] +. . A[j-1] + A[j] = K.The first line contains two integers N and K.

The second line contains N space separated integers -  A<sub>1</sub>, A<sub>2</sub>,. . A<sub>n</sub>.

<b> Constraints: </b>
1 ≤ N ≤ 50000
-10<sup>9</sup> ≤ K ≤ 10<sup>9</sup>
-10<sup>9</sup> ≤ A[i] ≤ 10<sup>9</sup>Print a single integer denoting the minimum number of moves required.Sample Input 1:
3 4
-2 8 2

Sample Output 1:
2

Sample Explanation 1:

Decrement the 2nd element twice, the array become [-2, 6, 2]. Now the segment [1, 2], i. e, [-2, 6] has sum 4., I have written this Solution Code: 
import sys,math,heapq,bisect
input = sys.stdin.readline
sys.setrecursionlimit(10**5)

ints = lambda : list(map(int,input().split()))
p = 10**9+7
inf = 10**20+7

n,k = ints()
a = ints()
ans = inf
s = 0
store = [0]
for i in range(n):
    s += a[i]
    x = s-k
    ind = bisect.bisect_left(store,x)
    if ind!=0:
        ans = min(ans,abs(x-store[ind-1]))
    if ind!=i+1:
        ans = min(ans,abs(x-store[ind]))
    bisect.insort(store,s)

print(ans), In this Programming Language: Python, Now tell me if this Code is compilable or not?