[Python] Sort All Coordinates
Put all valid coordinates to a list res\n\nSort all coordinates by the following rule:\n\n0. Change coordinates to a relative coordinates to center.\n\n1. Sort 
Put all valid coordinates to a list `res`\n\nSort all coordinates by the following rule:\n\n0. Change coordinates to a relative coordinates to center.\n\n1. Sort ascending by the distance to the center `max(abs(x), abs(y))`\nIf `max(abs(x), abs(y)) == 0`, it\'s the center.\nIf `max(abs(x), abs(y)) == 1`, it\'s in the first layer around the center\n\n2. Sort descending by the angle to the center `max(abs(x), abs(y))`\n\n\n**Python:**\n```\n    def spiralMatrixIII(self, R, C, r, c):\n        def key((x, y)):\n            x, y = x - r, y - c\n            return (max(abs(x), abs(y)), -((math.atan2(-1, 1) - math.atan2(x, y)) % (math.pi * 2)))\n        return sorted([(i, j) for i in xrange(R) for j in xrange(C)], key=key)\n```\n
[]