import sys input = lambda: sys.stdin.readline().rstrip() from collections import deque class CHT(): # Convex Hull Trick, Sorted Lines, Sorted Queries, Min Query # add_line は a の降順 # query は x の昇順 def __init__(self): self.Q = deque() def calc(self, f, x): return f[0] * x + f[1] def check(self, f1, f2, f3): return (f2[0] - f1[0]) * (f3[1] - f2[1]) >= (f2[1] - f1[1]) * (f3[0] - f2[0]) def add_line(self, a, b): f = (a, b) if len(self.Q) and self.Q[-1][0] == a: if self.Q[-1][1] > b: self.Q.pop() else: return while len(self.Q) >= 2 and self.check(self.Q[-2], self.Q[-1], f): self.Q.pop() self.Q.append(f) def query(self, x): while len(self.Q) >= 2 and self.calc(self.Q[0], x) >= self.calc(self.Q[1], x): self.Q.popleft() return self.calc(self.Q[0], x) def calc(n, X): x_y0 = 0 for i, (x, y) in enumerate(X): if y == 0: x_y0 = x del X[i] break ans = 0 if x_y0: may = 0 for x, y in X: may = max(may, abs(y)) ans = abs(x_y0) * may X.sort(key = lambda x: x[1]) cht1 = CHT() for x, y in X: cht1.add_line(-y, x) cht2 = CHT() for x, y in X[::-1]: cht2.add_line(y, -x) X = [(x, y, x / y) for x, y in X] X.sort(key = lambda x: x[2]) for x, y, z in X: ans = max(ans, y * cht1.query(z) if y < 0 else -y * cht2.query(z)) return round(ans) N = int(input()) X = [] for _ in range(N): x, y = map(int, input().split()) X.append((x, y)) print(calc(N, X))