一下子没想到二分算法,但是发现了点规律。
直接两个sort就过了
include [HTML_REMOVED]
include [HTML_REMOVED]
include [HTML_REMOVED]
using namespace std;
const int N=10010;
vector[HTML_REMOVED] b,c;
int main()
{
int n;
cin>>n;
while(n–)
{
int x,y;
cin>>x>>y;
b.push_back(x/(y+1)+1);
c.push_back(x/y);
}
sort(b.begin(),b.end());
sort(c.begin(),c.end());
cout<<b[b.size()-1]<<” “<<c[0]<<endl;
return 0;
}