Function to calculate maximum value that can be placed at the Kth index in a distribution in which difference of adjacent elements is less than 1 and total sum of distribution is M .
def calculateMax ( N , M , K ) : NEW_LINE