//2_1_2: Ride to School 骑自行车跟上同学 POJ1922 ZOJ2229
#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
const double limit = 100000000;
int main()
{
int i,N,time,speed;
double min,sum;
while(scanf("%d",&N),N != 0)
{
min = limit;
for(i = 0;i < N;i ++)
{
scanf("%d %d",&speed,&time);
if(time < 0) continue;
sum = time + 4.5 * 3600 / speed;
if(sum < min) min = sum;
}
time = (int)min;
if(min > time) printf("%d\n",time + 1);
else printf("%d\n",time);
}
return 0;
}
/*测试结果:通过POJ1922 ZOJ2229检测
4
20 0
25 -155
27 190
30 240
780
2
21 0
22 34
771
0
请按任意键继续. . .
*/
POJ1922 ZOJ2229 Ride to School
最新推荐文章于 2018-10-02 22:30:45 发布