Company: Barclays
Difficulty: medium
Maximum Oil Transport in a Network The current selected programming language is C++14 . We emphasize the submission of a fully working code over partially correct but efficient code. Once submitted, you cannot review this problem again. You can use cout to debug your code. The cout may not work in case of syntax/runtime error. The version of GCC being used is 5.5.0 . Theon is an energy engineer. His job is to transport oil from the base refinery to the main storage units through a network of pipes. The network is in the form of a tree, where the base refinery is the root and the main storage units are the leaves. The pipes are connected to the storage units via internal connecting stations. The pipes can have different transfer rates [liter of oil per unit of time]. He wishes to determine the maximum amount of oil that can be transported via the network at any given time. Input Format The first line of the input consists of an integer num , representing the number of stations in the ne