0
已解决
王泽宇
初级光能
初级光能
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<string>
#include<iomanip>
#include<cstring>
#include<sstream>
using namespace std;
struct Stu{
int x,y,z;
long long sum(){
return x*y*z;
}
}a[11111];
bool cmp(Stu x,Stu y){
return x.sum()<y.sum();
}
int main(){
//freopen("gift.in","r",stdin);
//freopen("gift.out","w",stdout);
int n,q,p,o,z,cnt=0,i=0;
cin>>n>>q>>p>>o;
z=p*q*o;
for(int i=0;i<n;i++){
cin>>a[i].x>>a[i].y>>a[i].z;
}
while(z>0){
z-=a[i].sum();
if(z>0) i++;
}
cout<<i;
//fclose(stdin);
//fclose(stdout);
return 0;
}
?????