Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- int main()
- {
- int a,b,c,i,k,j;
- string item1[10000],item2[10000],com1,com2;
- double price;
- while(1)
- {
- int t=0;
- cin>>a>>b;
- if(a==0 || b==0)
- break;
- for(i=0;i<a;i++)
- cin>>item1[i];
- int max=0;
- double min=1000000000.0;
- for(k=0;k<b;k++)
- {
- cin>>com1;
- cin>>price>>c;
- for(j=0;j<c;j++)
- cin>>item2[j];
- if(c>max)
- {
- max=c;
- min=price;
- com2=com1;
- }
- else if(c==max)
- {
- max=c;
- if(price<min)
- {
- min=price;
- com2=com1;
- }
- }
- }
- cout<<"RFP #"<<++t<<":"<<endl<<com2<<endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement