-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBaek_14888.py
More file actions
61 lines (48 loc) · 993 Bytes
/
Baek_14888.py
File metadata and controls
61 lines (48 loc) · 993 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
52
53
54
55
56
57
58
59
60
61
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = [i for i in b]
def per(x,y,u):
if y == (u-1):
u.add(x)
for i in range(u-1):
ma = 0
mi = 0
d = a[0]
e = a[0]
for i in range(n-1):
if b[1] > 0:
d -= a[i+1]
b[1] -=1
print("max:-")
elif b[3] > 0:
d //= a[i+1]
b[3] -=1
print("max://")
elif b[0] > 0:
d += a[i+1]
b[0] -=1
print("max:+")
elif b[2] > 0:
d *= a[i+1]
b[2] -=1
print("max:*")
for i in range(n-1):
if c[0] > 0:
e += a[i+1]
c[0] -=1
print("min:+")
elif c[3] > 0:
e //= a[i+1]
print("min://")
c[3] -=1
elif c[1] > 0:
e -= a[i+1]
c[1] -=1
print("min:-")
elif c[2] > 0:
e *= a[i+1]
c[2] -=1
print("min:*")
print(d)
print(e)