Phone Call

각 전화선은 주어진 두 경로 위의 서로 다른 두 집을 정해진 비용으로 연결한다. 1번 집에서 초대를 퍼뜨릴 때 참여할 수 있는 최대 인원과 그때의 최소 총비용을 구한다.

어려움9그래프최소 신장 트리트리아직 제출이 없습니다시간 제한1초메모리 제한512 MB

문제

There are nn houses in Bytetown, labeled by 11, 22, \ldots, nn. There is one person living in each house. Little Q lives in house 11. There are n1n - 1 bidirectional streets connecting these houses, forming a tree structure. In this problem, S(u,v)S (u, v) denotes the set containing all the houses on the shortest path from house uu to house vv.

The Bytetown's phone line network consists of mm different lines. The ii-th line can be described by five integers a_ia\_i, b_ib\_i, c_ic\_i, d_id\_i and w_iw\_i which mean that, for any two different houses uu and vv from the set S(a_i,b_i)S(c_i,d_i)S (a\_i, b\_i) \cup S (c\_i, d\_i), uu and vv can have a phone call which costs w_iw\_i dollars.

Little Q is now planning to hold a big party in his house, and he wants to invite as many people as possible. Everyone who knows about the invitation can make any number of phone calls to others to spread the invitation, but nobody can leave their house.

Write a program to find the maximum number of people that can join the party, and the minimum total cost to reach this maximum number of people. Little Q should be counted in the answer.

입력

The first line of the input contains two integers nn and mm: the number of houses and the number of phone lines (1n,m1051 \leq n, m \leq 10^5).

Each of the next n1n - 1 lines contains two integers uu and vv, denoting a bidirectional street between houses uu and vv. It is guaranteed that the houses and the streets form a tree.

In the next mm lines, the ii-th line contains five integers a_ia\_i, b_ib\_i, c_ic\_i, d_id\_i and w_iw\_i describing a phone line (1a_i,b_i,c_i,d_in1 \leq a\_i, b\_i, c\_i, d\_i \leq n, 1w_i1091 \leq w\_i \leq 10^9).

출력

Print a single line containing two integers: the maximum number of people that can join the party and the minimum total cost to reach that maximum number.

힌트

One possible solution is as follows.

Step 1: house 1 makes a phone call to house 2 using line 1, the cost is 100. 

Step 2: house 1 makes a phone call to house 3 using line 1, the cost is 100. 

Step 3: house 2 makes a phone call to house 4 using line 2, the cost is 10.