Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- streamCount = int(input())
- streamNum = int(0)
- flow = []
- while streamNum < streamCount:
- flow.append(float(input()))
- streamNum += 1
- while True:
- command = input()
- if command == '99':
- splitNum = int(input()) - 1
- splitRatio = int(input())
- oldFlow = float(flow[splitNum])
- flow[splitNum] = splitRatio * flow[splitNum] / 100
- newStreamFlow = float(oldFlow - flow[splitNum])
- flow.insert(splitNum+1, newStreamFlow)
- streamCount += 1
- elif command == '88':
- joinNum = int(input()) - 1
- streamCount -= 1
- flow[joinNum] += flow[joinNum+1]
- flow.pop(joinNum+1)
- else:
- break
- printCount = 0
- while printCount < streamCount:
- print(int(round(flow[printCount])), sep=' ', end=' ', flush=True)
- printCount += 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement