返回题解分享
讨论 / 题解分享/ 帖子详情

冶炼金属(编程题) - 题解

代码很简单,不加注释了

#include<bits/stdc++.h>
using namespace std;

int c[10000];  
int d[10000];

int main()
{
	int n;cin >> n;
	 
	for(int i = 0;i < n; ++ i)
	{
		int a, b;cin >> a >> b;
		c[i] = a / b;
		d[i] = a / (b + 1);
	}
	
	sort(c, c + n);
	sort(d, d + n);
	
	cout << d[n - 1] + 1 << ' ';
	cout << c[0];
	
	return 0;
}
0 回复 0 转发 3 喜欢 3 阅读
回复 (0)
默认 最新
暂无回复,快来抢沙发!