#include<iostream>
#include<string>
#include<cmath>
using namespace std;
int main()
{
string nam[10000];
int n,arry[10000];
cin >> n;
for (int i = 0; i < n; i++)
cin >> nam[i] >> arry[i];
int sum = 0,m=0;
for (int i = 0; i < n; i++)
sum += arry[i];
sum /= n*2;
for (int i = 0; i < n; i++)
arry[i] = fabs(sum - arry[i]);
for (int i = 1; i < n; i++)
if (arry[i] < arry[m]) m = i;
cout << sum <<' ';
cout<<nam[m];
}
团体程序设计天梯赛 L1-056 猜数字
最新推荐文章于 2024-08-16 08:17:29 发布