{"trustable":true,"prependHtml":"\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\" type\u003d\"text/javascript\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv class\u003d\"panel_content\"\u003eNoticeļ¼Don\u0027t output extra spaces at the end of one line.\u003cbr\u003e\u003cbr\u003eKoishi loves Subterranean Animism(SA).\u003cbr\u003e\u003cbr\u003eThe map of SA is a undirected tree with $n$ nodes and $n-1$ roads. \u003cbr\u003e\u003cbr\u003eKoishi loves wander around SA by Rin\u0027s corpse cart. The cart use nuclear power. It take $1$ point power to pass one road. Koishi has $q$ wandering plan, in the $i$-th plan Koishi wants to wander from $x_i$ to $y_i$, and the cart has $p_i$ points of power initially.\u003cbr\u003e\u003cbr\u003eObviously, in some plans, Koishi can\u0027t arrive the destination. To avoid this, Koishi asks Utsuho to set some nuclear-power filling station. There are $m$ such stations. The $i$-th of them is located in the node $c_i$ and the level of this station is $d_i$. When Koishi arrive node $c_i$, she can add $(d_i-s)$ points of power to her cart or do nothing. Here $s$ represents the amount of power the cart has currently. \u003cbr\u003e\u003cbr\u003eFor each plan, Koishi wants to know whether this plan can be finished successfully. Notice that she can pass the same road many times.\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"The first line contains of a positive integer $T(1\\leq T\\leq 500)$, representing $T$ test cases.\u003cbr\u003e\u003cbr\u003ein each test case, the first line contains three positive integers $n,m,q(1\\leq n,m,q\\leq 10^5)$,representing the number of nodes, power stations and plans.\u003cbr\u003e\u003cbr\u003eEach of the following $n-1$ lines contains two positive integers $u_i,v_i$, representing a road between $u_i$ and $v_i$. It guarantees the input map is a tree.\u003cbr\u003e\u003cbr\u003eEach of the following $q$ lines contains three positive integers $x_i,y_i,p_i(1\\leq x_i,y_i\\leq n,1\\leq p_i\\leq 10^9)$. It describes the $i$-th plan.\u003cbr\u003e\u003cbr\u003eEach of the following $m$ lines contains two positive integers $c_i,d_i(1\\leq c_i\\leq n,1\\leq d_i\\leq 10^9)$. It describes the $i$-th power-stations.\u003cbr\u003e\u003cbr\u003eThere are at most $500$ test cases and at most $12$ test cases with $n+m+q\u0026gt;5000$ "}},{"title":"Output","value":{"format":"HTML","content":"For each test case, output $q$ lines.\u003cbr\u003e\u003cbr\u003ein the $i$-th line, if the $i-$th plan can be finished, output \"YES\", otherwise, output \"NO\""}},{"title":"Sample","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e2\r\n10 3 10\r\n2 1\r\n3 1\r\n4 2\r\n5 1\r\n6 2\r\n7 1\r\n8 2\r\n9 5\r\n10 6\r\n7 2 3\r\n2 6 1\r\n8 8 3\r\n8 6 3\r\n10 3 1\r\n7 9 2\r\n9 5 3\r\n2 2 2\r\n9 8 2\r\n7 10 3\r\n9 1\r\n7 2\r\n8 1\r\n10 3 10\r\n2 1\r\n3 1\r\n4 3\r\n5 4\r\n6 3\r\n7 3\r\n8 6\r\n9 8\r\n10 6\r\n7 9 1\r\n6 8 2\r\n6 9 2\r\n4 3 1\r\n6 9 2\r\n5 2 1\r\n8 2 3\r\n1 5 2\r\n9 5 2\r\n7 10 2\r\n9 1\r\n6 1\r\n2 1\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eYES\r\nYES\r\nYES\r\nYES\r\nNO\r\nNO\r\nYES\r\nYES\r\nNO\r\nNO\r\nNO\r\nYES\r\nYES\r\nYES\r\nYES\r\nNO\r\nNO\r\nNO\r\nNO\r\nYES\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}