""" lt = less than A, Bにおいて、A=BならTrue、そうでないならFalse """ #↓を自由に書き換える class K: x: int y: int a: int def __init__(self, p): self.x, self.y = p self.a = 0 if self.y > 0 or (self.y == 0 and self.x > 0) else 1 def __lt__(self, o): return self.a < o.a if self.a != o.a else self.x * o.y > self.y * o.x def __ge__(self, o) -> bool: return not self.__lt__(o) """ 使用例 N = int(input()) mem = [] bit_mem = [] for _ in range(N): nu = input().split() X, Y = int(nu[0]), int(nu[1]) mem.append((X, Y)) bit_mem.append((X, Y)) bit_mem.append((-X, -Y)) bit_mem.sort(key=K) """