import sys, random input = lambda : sys.stdin.readline().rstrip() sys.setrecursionlimit(3*10**5+10) write = lambda x: sys.stdout.write(x+"\n"); writef = lambda x: print("{:.12f}".format(x)) debug = lambda x: sys.stderr.write(x+"\n") YES="Yes"; NO="No"; pans = lambda v: print(YES if v else NO); inf=10**18 LI = lambda : list(map(int, input().split())) def debug(_l_): for s in _l_.split(): print(f"{s}={eval(s)}", end=" ") print() def dlist(*l, fill=0): if len(l)==1: return [fill]*l[0] ll = l[1:] return [dlist(*ll, fill=fill) for _ in range(l[0])] from collections import deque class CHT: """傾きが単調減少かつ評価点が単調増加のときの最小値クエリ """ def __init__(self): self.q = deque() @staticmethod def _val(t,x): return t[0]*x+t[1] @staticmethod def _check(t1,t2,t3): return (t2[0]-t1[0]) * (t3[1]-t2[1]) >= (t2[1]-t1[1]) * (t3[0]-t2[0]) def add(self, a, b): """a*x + bの追加 """ t = (a,b) while len(self.q)>=2 and self._check(self.q[-2], self.q[-1], t): # 追加する線分と最後から2番めの線分のCHだけで凸包になる self.q.pop() self.q.append(t) def query(self, x): """a*x+bの最小値を返す """ while len(self.q)>=2 and self._val(self.q[0], x) >= self._val(self.q[1], x): self.q.popleft() return self._val(self.q[0], x) n = int(input()) xy = [LI() for _ in range(n)] zx = None zy = None nxy = [] mx = my = 0 for x,y in xy: mx = max(mx, abs(x)) my = max(my, abs(y)) if x==0: zx = (x,y) elif y==0: zy = (x,y) else: nxy.append((x,y)) xy = nxy xy.sort(key=lambda item: item[0]) t = CHT() t2 = CHT() for x,y in xy: t.add(-x,y) for x,y in xy[::-1]: t2.add(x, -y) xy.sort(key=lambda item: item[1]/item[0]) ans = 0 for x,y in xy: v = t.query(y/x) v2 = -t2.query(y/x) if x<0: ans = max(ans, x*v) else: ans = max(ans, x*v2) if zx is not None: ans = max(ans, abs(zx[1])*mx) if zy is not None: ans = max(ans, abs(zy[0])*my) print(int(ans+0.01))