-
Notifications
You must be signed in to change notification settings - Fork 0
/
10141 - Request for Proposal.cpp
65 lines (65 loc) · 1.57 KB
/
10141 - Request for Proposal.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/*
||-----------------------------------||
|| Rahat Khan Pathan ||
|| BGC Trust University ||
|| Department of CSE ||
||-----------------------------------||
*/
#include<bits/stdc++.h>
#define ll long long int
#define pub push_back
#define PI 3.14159265359
#define vll vector<ll>
#define All(X) (X).begin(),(X).end()
#define Unique(X) (X).erase(unique(All(X)),(X).end()))
#define fast ios_base::sync_with_stdio(0); cin.tie(0);
#define pi pair<ll,ll>
#define vpair vector<pair<ll,ll> >
#define yes cout<<"YES"<<endl
#define no cout<<"NO"<<endl
#define minus cout<<-1<<endl
using namespace std;
ll ts=1;
int main()
{
ll n,m;
while(cin>>n>>m)
{
if(n==0 && m==0) break;
string a,b,ans;
double money,saveMoney=INT_MAX;
ll in,save=INT_MIN,cnt,i,j;
getchar();
for(i=0;i<n;i++)
{
getline(cin,a);
}
for(i=0;i<m;i++)
{
getline(cin,a);
cin>>money>>in;
getchar();
for(j=0;j<in;j++)
{
getline(cin,b);
}
if(in>save)
{
save=in;
saveMoney=money;
ans=a;
}
else if(in==save && money<saveMoney)
{
saveMoney=money;
ans=a;
}
}
if(ts>1)
cout<<endl;
cout<<"RFP #"<<ts<<endl;
ts++;
cout<<ans<<endl;
}
return 0;
}