若干个人,他们有同样体积的泥巴,但有个人从别人那里拿了一点,最后他们把泥巴弄成长方体
告诉长方体三边长度问谁从谁那里拿了泥巴
= =简单题...最大的从最小那里拿肯定
#include<bits/stdc++.h>
using namespace std;
int n;
typedef pair<int ,string>pii;
void Gao()
{
vector<pii>a;
for (int i=0;i<n;i++)
{
int x,y,z;
string tem;
cin>>x>>y>>z>>tem;
a.push_back(make_pair(x*y*z,tem));
}
sort(a.begin(),a.end());
cout<<a[n-1].second;
cout<<" took clay from ";
cout<<a[0].second<<"."<<endl;
}
int main()
{
while (cin>>n && n!=-1)
Gao();
return 0;
}