-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBankAccounts.cpp
More file actions
65 lines (63 loc) · 1.21 KB
/
BankAccounts.cpp
File metadata and controls
65 lines (63 loc) · 1.21 KB
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
/*
* Goldman Sachs CodeSprint 1
* Created by Ziyi Tang
*
*/
//#include <bits/stdc++.h>
#include <iostream>
#include <cstdio>
#include <string>
#include <cstring>
#include <cstdlib>
#include <sstream>
#include <cmath>
#include <algorithm>
#include <list>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <bitset>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pi;
typedef vector<pi> vpi;
typedef vector<vpi> vvpi;
typedef vector<double> vd;
typedef vector<vd> vvd;
const int INF = 0x3f3f3f3f;
const ll INFL = (ll)1E18;
const int dir[4][2] = {{-1,0},{0,1},{1,0},{0,-1}};
#define REP(i,s,t) for(int i=(s);i<(t);i++)
#define FILL(x,v) memset(x,v,sizeof(x))
#define ISZERO(x) (fabs(x) < EPS)
#define ISPOS(x) ((x) > EPS)
#define MAXN 1000
#define MOD 1000000007
vi all;
int main(){
int test;
cin >> test;
while(test--){
all.clear();
int n,k,x,d; cin >> n >> k >> x >> d;
REP(i,0,n){
int tmp;
cin >> tmp;
all.push_back(tmp);
}
double cost = 0.0;
REP(i,0,n){
cost += max((double)k, x*all[i]*1.0/100);
}
if(cost <= d){
cout << "fee" << endl;
} else {
cout << "upfront" << endl;
}
}
return 0;
}