Question: solve fast please Problem Description There are A cities connected by A-1 bi-directional roads such that all the cities are connected. Roads are given by


![given by array 2D array B where ith road connects B[i][0] city](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f4eeed364d9_98066f4eeec9daa6.jpg)
![to B[i][1]. You go on C trips where on the i-th trip](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f4eeee15396_98166f4eeed7db88.jpg)
solve fast please
Problem Description There are A cities connected by A-1 bi-directional roads such that all the cities are connected. Roads are given by array 2D array B where ith road connects B[i][0] city to B[i][1]. You go on C trips where on the i-th trip you travel from C[i][0] city to C[i][1] city. All the trips are independent of eaeh. other. You have to pay a tax on D[i] on entering or leaving the i-th city. If you pay the tax while entering then you don't need to pay at the time of leaving. You can choose some non-adjacent cities and make their tax half. What can be the minimum sum of taxes you pay for all the C trips? Since the answer can be large, return the remainder after dividing it by 109+7. Problem Constraints 2
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
