← Back to List

29734번: 집에선 안돼잉 ↗

Solutions

Python 3
253 B | 253 chars
N, M = map(int, input().split())
T, S = map(int, input().split())

c1 = N // 8 - (0 if N % 8 else 1)
c2 = M // 8 - (0 if M % 8 else 1)

a = N + c1 * S
b = M + c2 * S + (2 * c2 + 1) * T

if a < b:
  print("Zip")
  print(a)
else:
  print("Dok")
  print(b)