-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathday48.py
More file actions
51 lines (35 loc) · 877 Bytes
/
day48.py
File metadata and controls
51 lines (35 loc) · 877 Bytes
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
#!/bin/python3
import os
import sys
#
# Complete the taumBday function below.
#
def taumBday(b, w, bc, wc, z):
res = 0
if bc <= wc:
res += bc*b
if bc + z <= wc:
res += (bc + z)*w
else:
res += wc*w
else:
res += wc*w
if wc + z <= bc:
res += (wc + z)*b
else:
res += bc*b
return res
if __name__ == '__main__':
fptr = open(os.environ['OUTPUT_PATH'], 'w')
t = int(input())
for t_itr in range(t):
bw = input().split()
b = int(bw[0])
w = int(bw[1])
bcWcz = input().split()
bc = int(bcWcz[0])
wc = int(bcWcz[1])
z = int(bcWcz[2])
result = taumBday(b, w, bc, wc, z)
fptr.write(str(result) + '\n')
fptr.close()