F - Ride to School(2.1.2)

F - Ride to School(2.1.2)
Time Limit:1000MS     Memory Limit:30000KB     64bit IO Format:%I64d & %I64u

Description

Many graduate students of Peking University are living in Wanliu Campus, which is 4.5 kilometers from the main campus – Yanyuan. Students in Wanliu have to either take a bus or ride a bike to go to school. Due to the bad traffic in Beijing, many students choose to ride a bike. 

We may assume that all the students except "Charley" ride from Wanliu to Yanyuan at a fixed speed. Charley is a student with a different riding habit – he always tries to follow another rider to avoid riding alone. When Charley gets to the gate of Wanliu, he will look for someone who is setting off to Yanyuan. If he finds someone, he will follow that rider, or if not, he will wait for someone to follow. On the way from Wanliu to Yanyuan, at any time if a faster student surpassed Charley, he will leave the rider he is following and speed up to follow the faster one. 

We assume the time that Charley gets to the gate of Wanliu is zero. Given the set off time and speed of the other students, your task is to give the time when Charley arrives at Yanyuan. 

Input

There are several test cases. The first line of each case is N (1 <= N <= 10000) representing the number of riders (excluding Charley). N = 0 ends the input. The following N lines are information of N different riders, in such format: 

Vi [TAB] Ti 

Vi is a positive integer <= 40, indicating the speed of the i-th rider (kph, kilometers per hour). Ti is the set off time of the i-th rider, which is an integer and counted in seconds. In any case it is assured that there always exists a nonnegative Ti. 

Output

Output one line for each case: the arrival time of Charley. Round up (ceiling) the value when dealing with a fraction.

Sample Input

4
20	0
25	-155
27	190
30	240
2
21	0
22	34
0

Sample Output

780
771
#include<iostream>
using namespace std;
int main()
{ 
	double ss;
	int min=-10,a,b,n;
	while(cin>>n&&n)
	{
		min=100000;
	//	cin>>n;

		while(n--)
		{

			cin>>a>>b;
			if(b>=0)
			{ss=4.5*60*60/a+b;
			    if(ss<min)
				{if(ss>int(ss))
				ss++;
				min=ss;}
			}
		}
		cout<<min<<endl;
	}

return 0;
}


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
datax-web-2.1.2是一个版本为2.1.2的DataX Web工具。要安装datax-web-2.1.2,您可以按照以下步骤进行操作: 1. 下载datax-web-2.1.2.tar.gz压缩包,并将其放置在服务器上。 2. 解压缩datax-web-2.1.2.tar.gz文件,可以使用命令:tar -zxvf datax-web-2.1.2.tar.gz。 3. 进入解压后的目录,并执行安装脚本。如果您想使用交互模式安装,可以运行./bin/install.sh命令,并按照提示填写MySQL信息。如果您不想使用交互模式,可以运行./bin/install.sh --force命令跳过确认过程。 4. 修改控制器datax-admin的配置文件,即./datax-web-2.1.2/modules/datax-admin/conf/application.yml文件。 5. 修改执行器datax-executor的配置文件,即./datax-web-2.1.2/modules/datax-executor/conf/application.yml文件。 6. 如果您的数据库还没有创建和授权,您可以按照以下步骤进行操作: - 使用MySQL 8.0及以上版本创建数据库:create database `datax-web` character set utf8mb4; - 创建用户并授权:CREATE USER 'datax'@'%' IDENTIFIED BY '111111'; grant all privileges on *.* to datax@'%' with grant option; - 修改用户密码:ALTER USER 'datax'@'%' IDENTIFIED WITH mysql_native_password BY '111111'; 7. 启动datax-web,进入./datax-web-2.1.2/bin目录,并执行./start-all.sh命令,即可同时启动控制器和执行器。如果您想单独启动,可以使用命令./start.sh -m datax-admin或./start.sh -m datax-executor。 请注意,以上步骤仅适用于datax-web-2.1.2版本。如果您使用的是其他版本,请参考相应的安装文档。 #### 引用[.reference_title] - *1* *2* *3* [datax与datax-web安装部署](https://blog.csdn.net/m0_71142057/article/details/124898812)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^koosearch_v1,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值