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

 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

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!