SP31342 SIMPLEPATH - Simple Path

Description

You will be given a weighted rooted tree, where root is node 1. For each subtree of that tree, you will have to compute the summation of lengths of all possible simple paths present in that subtree. Eventually you need to print the summation of those values modulo **1000000007**. Image of the tree in the first sample is given below. ![Image of the tree in the first sample is given below.](https://cdn.luogu.com.cn/upload/vjudge_pic/SP31342/428312a17dbb4c1d9ba923394206001d2cd3ca0b.png) **Input Specification** First line of input will contain an integer **T (1

Input Format

N/A

Output Format

N/A