{"raw_statement":[{"iden":"problem statement","content":"Given is a weighted undirected connected graph $G$ with $N$ vertices and $M$ edges, which may contain self-loops and multi-edges.  \nThe vertices are labeled as Vertex $1$, Vertex $2$, $\\dots$, Vertex $N$.  \nThe edges are labeled as Edge $1$, Edge $2$, $\\ldots$, Edge $M$. Edge $i$ connects Vertex $a_i$ and Vertex $b_i$ and has a weight of $c_i$. Here, for every pair of integers $(i, j)$ such that $1 \\leq i \\lt j \\leq M$, $c_i \\neq c_j$ holds.\nProcess the $Q$ queries explained below.  \nThe $i$\\-th query gives a triple of integers $(u_i, v_i, w_i)$. Here, for every integer $j$ such that $1 \\leq j \\leq M$, $w_i \\neq c_j$ holds.  \nLet $e_i$ be an undirected edge that connects Vertex $u_i$ and Vertex $v_i$ and has a weight of $w_i$. Consider the graph $G_i$ obtained by adding $e_i$ to $G$. It can be proved that the minimum spanning tree $T_i$ of $G_i$ is uniquely determined. Does $T_i$ contain $e_i$? Print the answer as `Yes` or `No`.\nNote that the queries do not change $T$. In other words, even though Query $i$ considers the graph obtained by adding $e_i$ to $G$, the $G$ in other queries does not have $e_i$.\nWhat is minimum spanning tree? The **spanning tree** of $G$ is a tree with all of the vertices in $G$ and some of the edges in $G$.  \nThe **minimum spanning tree** of $G$ is the tree with the minimum total weight of edges among the spanning trees of $G$."},{"iden":"constraints","content":"*   $2 \\leq N \\leq 2 \\times 10^5$\n*   $N - 1 \\leq M \\leq 2 \\times 10^5$\n*   $1 \\leq a_i \\leq N$ $(1 \\leq i \\leq M)$\n*   $1 \\leq b_i \\leq N$ $(1 \\leq i \\leq M)$\n*   $1 \\leq c_i \\leq 10^9$ $(1 \\leq i \\leq M)$\n*   $c_i \\neq c_j$ $(1 \\leq i \\lt j \\leq M)$\n*   The graph $G$ is connected.\n*   $1 \\leq Q \\leq 2 \\times 10^5$\n*   $1 \\leq u_i \\leq N$ $(1 \\leq i \\leq Q)$\n*   $1 \\leq v_i \\leq N$ $(1 \\leq i \\leq Q)$\n*   $1 \\leq w_i \\leq 10^9$ $(1 \\leq i \\leq Q)$\n*   $w_i \\neq c_j$ $(1 \\leq i \\leq Q, 1 \\leq j \\leq M)$\n*   All values in input are integers."},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$N$ $M$ $Q$\n$a_1$ $b_1$ $c_1$\n$a_2$ $b_2$ $c_2$\n$\\vdots$\n$a_M$ $b_M$ $c_M$\n$u_1$ $v_1$ $w_1$\n$u_2$ $v_2$ $w_2$\n$\\vdots$\n$u_Q$ $v_Q$ $w_Q$"},{"iden":"sample input 1","content":"5 6 3\n1 2 2\n2 3 3\n1 3 6\n2 4 5\n4 5 9\n3 5 8\n1 3 1\n3 4 7\n3 5 7"},{"iden":"sample output 1","content":"Yes\nNo\nYes\n\nBelow, let $(u,v,w)$ denote an undirected edge that connects Vertex $u$ and Vertex $v$ and has the weight of $w$. Here is an illustration of $G$:\n![image](https://img.atcoder.jp/ghi/15ac15edee5a8b055f65192d7323d43b.png)\nFor example, Query $1$ considers the graph $G_1$ obtained by adding $e_1 = (1,3,1)$ to $G$. The minimum spanning tree $T_1$ of $G_1$ has the edge set $\\lbrace (1,2,2),(1,3,1),(2,4,5),(3,5,8) \\rbrace$, which contains $e_1$, so `Yes` should be printed."},{"iden":"sample input 2","content":"2 3 2\n1 2 100\n1 2 1000000000\n1 1 1\n1 2 2\n1 1 5"},{"iden":"sample output 2","content":"Yes\nNo"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}