codeforces/574A_bear.py
def calculate(self):
        """ Main calcualtion function of the class """

        lamak = self.nums[0]
        srt = sorted(self.nums[1:])
        result = 0

        while lamak <= srt[-1]:
            srt[-1] -= 1
            lamak += 1
            result += 1
            srt = sorted(srt)

        return str(result)
 Main calcualtion function of the class 
Main calcualtion function of the class
Main calcualtion function of the class
def calculate(self):
        lamak = self.nums[0]
        srt = sorted(self.nums[1:])
        result = 0
        while lamak <= srt[-1]:
            srt[-1] -= 1
            lamak += 1
            result += 1
            srt = sorted(srt)
        return str(result)
def calculate ( self ) : lamak = self . nums [ 0 ] srt = sorted ( self . nums [ 1 : ] ) result = 0 while lamak <= srt [ - 1 ] : srt [ - 1 ] -= 1 lamak += 1 result += 1 srt = sorted ( srt ) return str ( result )
Main calcualtion function of the class
Main calcualtion function of the class
""" Main calcualtion function of the class """
self