Hirak Rajar Desh

Hirak Raja, the king of the country “Hirak Rajar Desh”, the conqueror ultimate, wanted to expand his kingdom. So, he decided to attack the Goopy kingdom. The Goopy kingdom consists of nnn islands (numbered from 1 to nnn) and n−1n-1n−1 bridges. Each island has a leader with a leadership value 1≤Li≤1001 \leq L_i \leq 1001≤Li​≤100. Each bridge connects two different islands and it is possible to travel from any island to any other island within the Goopy kingdom using the bridges.

This is a companion discussion topic for the original entry at https://toph.co/p/hirak-rajar-deshe