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