YELBRICK

YELBRICK

#include<iostream>
using namespace std;
int min(int a,int b)
{
if(a<b)return a;
else return b;
}

int main()
{

int t;
cin>>t;

while(t!=0)
{
unsigned long long int vol;int minb=1001,mina;
int a[t],b[t],c[t];
for(int i=0;i<t;i++)
{
cin>>a[i]>>b[i]>>c[i];
mina = min(a[i],min(b[i],c[i]));
if((mina<minb)&&(mina>0))minb = mina;
}

unsigned long long int tt=0;
vol=(minb*minb*minb);
for(int i=0;i<t;i++)
{
tt+= (a[i]*b[i]*c[i])/vol;
}
cout<<tt<<endl;

cin>>t;
}


}

No comments:

Post a Comment