/*
重要的不是会先遇到谁,而是会和谁走到最后
*/
#include
#include
#include
#include
#include
using namespace std;
struct xpoint{
int speed;
int offsettime;
double finishtime;
};
bool isShorter(const xpoint &p1,const xpoint &p2)
{
return p1.offsettime
}
int main()
{
int N;
xpoint temp;
while(scanf("%d",&N))
{
list indata;
if(N==0)
break;
for(int i=0;i {
scanf("%d%d",&temp.speed,&temp.offsettime);
temp.finishtime=temp.offsettime+16200.0/double(temp.speed);
if(temp.offsettime>=0)
indata.push_back(temp);
}
stable_sort(indata.begin(),indata.end(),isShorter);
list::iterator iptr,iptr2,iptrtemp;
iptr=indata.begin();
for(iptr2=indata.begin();iptr2!=indata.end();iptr2++)
{
if(iptr2->finishtimefinishtime)
{
iptr=iptr2;
}
}
printf("%d\n",(int)ceil(iptr->finishtime));
}
return 0;
}
阅读(1584) | 评论(1) | 转发(0) |