You are viewing a single comment's thread. Return to all comments →
def taumBday(b, w, bc, wc, z): if (bc <= wc): if (bc+z >= wc): return b*bc + w*wc else: return b*bc + w*(bc+z) elif (wc < bc): if (wc+z > bc): return w*wc + b*bc else: return w*wc + b*(wc+z) t = int(input()) while (t > 0): b, w = map(int, input().split()) bc, wc, z = map(int, input().split()) result = taumBday(b, w, bc, wc, z) print(result) t -= 1
Seems like cookies are disabled on this browser, please enable them to open this website
Taum and B'day
You are viewing a single comment's thread. Return to all comments →
for Python3 Platform