#include<iostream>
using namespace std;
int main()
{
int num; cin >> num;
int max = -1,min=1000000009;
for (int i = 0; i < num; i++)
{
int n = 0, target = 0;
scanf("%d %d", &n, &target);
if (min > n / target) min = n / target;
if (max < (n / (target + 1)) + 1) max = (n / (target + 1)) + 1;
}cout <<max <<" " << min << endl;
return 0;
}