from collections import Counter, deque, defaultdict from heapq import heapify, heappop, heappush, nlargest, nsmallest from bisect import bisect_left, bisect, bisect_right from copy import deepcopy from time import perf_counter import sys from typing import Any, List, Callable def debug(*args, sep=" ", end="\n") -> None: print(*args, sep=sep, end=end, file=sys.stderr) def main(): global inf, MOD input = sys.stdin.read().split() ptr = 0 inf = float("inf") MOD = 998244353 N = int(input[ptr]); ptr += 1 M = 200000 MA = [[0, 0] for _ in range(M + 1)] for _ in range(N): a, b = map(int, input[ptr:ptr + 2]); ptr += 2 if MA[a][0] < b: MA[a] = [b, MA[a][0]] elif MA[a][1] < b: MA[a][1] = b ans = max(row[1] for row in MA) for g in range(1, M + 1): L = [] for a in range(g, M + 1, g): b = MA[a][0] if b > 0: L.append((a // g, b)) if len(L) < 2: continue L.sort(key=lambda x: x[0] * x[1], reverse=True) alt = 0 aa = inf for a, b in L: if alt < b // aa: alt = b // aa if aa > a: aa = a if ans < alt: ans = alt print(ans) if __name__ == "__main__": main()