题目描述
NIO is playing a game about trees. The game has two trees A,BA, BA,B each with NNN vertices. The vertices in each tree are numbered from 111 to NNN and the iii-th vertex has the weight viv_ivi. The root of each tree is vertex 1. Given KKK key n…