시간 제한메모리 제한제출정답맞힌 사람정답 비율
5 초 (추가 시간 없음) 1024 MB222100.000%

## 문제

The road network of Byteland kingdom consists of $n$ cities numbered from $1$ to $n$, connected with $n-1$ bidirectional roads. Each road has length $1$. The road network is connected and its graph forms a tree.

There are $m$ military towers in the kingdom. The $i$-th of them is situated in the city $a_i$ and has region of protection with radius $r_i$. A city $v$ is protected by the tower $i$ if the travelling distance between $v$ and $a_i$ doesn't exceed $r_i$.

King of Byteland is going to choose one of the cities as the new capital. The capital should be protected by all towers. The king can invest in extending protection of any existing tower. Increasing the radius of protection of any tower by any non-negative integer $x$ costs $\lceil\frac{x}{k}\rceil$ coins. Find the smallest total amount of coins the king has to spend so that the capital protected by all towers can be chosen.

## 입력

The first line contains three integers $n, m, k$ ($1\leq n, m\leq 10^5$, $1\leq k\leq 10$) --- the number of cities, the number of towers, and the divisor for payment function respectively.

The next $n-1$ lines describe the roads. The $i$-th of these contains three integers $u_i, v_i$ ($1\leq u_i, v_i\leq n$) --- indices of cities connected by the $i$-th road. It is guaranteed that the given graph is a tree.

The next $m$ lines describe the towers. The $i$-th of these lines contains two integers $a_i, r_i$ ($1\leq a_i\leq n$, $0\leq r_i\leq 10^9$) --- the index of the city where the $i$-th tower is situated, and the radius of its protection.

## 출력

Print one integer --- the smallest amount of coins needed to spend on tower upgrades so that a new capital can be chosen.

## 예제 입력 1

3 2 1
1 2
2 3
1 1
3 0


## 예제 출력 1

1


## 예제 입력 2

5 2 1
1 2
2 3
3 4
4 5
1 0
5 0


## 예제 출력 2

4


## 예제 입력 3

6 2 2
1 2
2 3
3 4
4 5
5 6
1 0
6 2


## 예제 출력 3

2