For this Question: Given an integer K and an array height[] of size N, where height[i] denotes the height of the ith tree in a forest. The task is to make a cut of height X from the ground such that at max K units wood is collected. Find the minimum value of X
<b>If you make a cut of height X from the ground then every tree with a height greater than X will be reduced to X and the remaining part of the wood can be collected</b>The first line contains two integers N and K.
The next line contains N integers denoting the elements of the array height[]

<b>Constraints</b>
1 &le; N &le; 10<sup>5</sup>
1 &le; arr[i] &le; 10<sup>5</sup>
1 &le; K &le; 10<sup>7</sup>Print a single integer with the value of X.Sample Input:
4 2
1 2 1 2

Sample Output:
1

<b>Explanation:</b>
Make a cut at height 1, the updated array will be {1, 1, 1, 1} and
the collected wood will be {0, 1, 0, 1} i. e. 0 + 1 + 0 + 1 = 2., I have written this Solution Code: def minCut(arr,k):
    mini = 1
    maxi = k
    mid = 0
    while mini<=maxi:
        mid = mini + int((maxi - mini)/2)
        wood = 0
        for j in range(n):
            if(arr[j]-mid>=0):
                wood += arr[j] - mid
        if wood == k:
            break;
        elif wood > k:
            mini = mid+1
        else:
            maxi = mid-1
    print(mini)            
n,k = list(map(int, input().split()))
arr = list(map(int, input().split()))
minCut(arr,k), In this Programming Language: Python, Now tell me if this Code is compilable or not?