Gi is a naughty child. He often does some strange things. Therefore, his father decides to play a game with him.
Gi's father is a senior magician, he teleports Gi and Gi's Slipper into a labyrinth. To simplify this problem, we regard the labyrinth as a tree with $n$ nodes, rooted at node $1$. Gi is initially at node $s$, and his slipper is at node $t$. In the tree, going through any edge between two nodes costs $w$ unit of power.
Gi is also a little magician! He can use his magic to teleport to any other node, if the depth difference between these two nodes equals to $k$. That is, if two nodes $u,v$ satisfying that $|dep_u-dep_v|=k$, then Gi can teleport from $u$ to $v$ or from $v$ to $u$. But each time when he uses magic he needs to consume $p$ unit of power. Note that he can use his magic any times.
Gi want to take his slipper with minimum unit of power.