Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- barrels = 0
- tests = 0
- V = []
- VS = []
- S = []
- input = open("input.txt", "r")
- output = open("output.txt", "w")
- s = input.read()
- s = s.split("\n")
- b = s[0].split(" ")
- del s[0]
- barrels = int(b[0])
- tests = int(b[1])
- for y in range(barrels):
- n = s[y]
- n = n.split(" ")
- V.append(int(n[0]))
- VS.append(int(n[1]))
- f = s[-1]
- f = f.split(" ")
- for z in f:
- S.append(int(z))
- def count(v, vs, s):
- ans = []
- a = 0
- string = ""
- for time in s:
- for x in range(len(v)):
- if (v[x] - vs[x] * time) >= 0:
- a += v[x] - vs[x] * time
- ans.append(a)
- a = 0
- for x in ans:
- string += str(x) + " "
- return string[0:-1]
- output.write(count(V, VS, S))
- input.close()
- output.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement