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

        result = []

        for i in range(self.imax):
            dmin = min(
                abs(self.nums[i] - self.nums[(i-1) % self.imax]),
                abs(self.nums[i] - self.nums[(i+1) % self.imax]))
            dmax = max(
                abs(self.nums[i] - self.nums[0]),
                abs(self.nums[i] - self.nums[-1]))
            result.append((dmin, dmax))

        return str("\n".join(" ".join(map(str, n)) for n in result))
 Main calcualtion function of the class 
Main calcualtion function of the class
Main calcualtion function of the class
def calculate(self):
        result = []
        for i in range(self.imax):
            dmin = min(
                abs(self.nums[i] - self.nums[(i-1) % self.imax]),
                abs(self.nums[i] - self.nums[(i+1) % self.imax]))
            dmax = max(
                abs(self.nums[i] - self.nums[0]),
                abs(self.nums[i] - self.nums[-1]))
            result.append((dmin, dmax))
        return str("\n".join(" ".join(map(str, n)) for n in result))
def calculate ( self ) : result = [ ] for i in range ( self . imax ) : dmin = min ( abs ( self . nums [ i ] - self . nums [ ( i - 1 ) % self . imax ] ) , abs ( self . nums [ i ] - self . nums [ ( i + 1 ) % self . imax ] ) ) dmax = max ( abs ( self . nums [ i ] - self . nums [ 0 ] ) , abs ( self . nums [ i ] - self . nums [ - 1 ] ) ) result . append ( ( dmin , dmax ) ) return str ( "\n" . join ( " " . join ( map ( str , n ) ) for n in result ) )
Main calcualtion function of the class
Main calcualtion function of the class
""" Main calcualtion function of the class """
self