Company: MediaNet_july
Difficulty: medium
Orange Tax Problem Description You live in Orange town. The town has A markets, numbered from 1 to A , connected by two-way roads. Every market sells oranges, and market i sells them at price B[i] . Every road has a base price. Travelling along a road with an empty cart costs exactly the road's base price. Travelling along it while carrying oranges costs the base price multiplied by the town's tax factor D . For example, if a road's base price is 5 and the tax factor is 3 , then crossing it with an empty cart costs 5 coins, while crossing it with oranges in the cart costs 5 * 3 = 15 coins. Starting at a market, you may buy oranges right there, or travel to some other market, buy the oranges there, and travel back to the market you started from. You leave with an empty cart and you come back carrying oranges. For every market i , report the minimum total number of coins needed to start at market i , buy oranges somewhere (possibly at market i itself), and end up back at m