{"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\"\u003e\u003cb\u003eIt is preferrable to read the pdf statment.\u003c/b\u003e\u003cbr\u003e\u003cbr\u003eIn response to the 8202 Olympics, Quber City, which was the host of the competition, is planning to build a magnificent stadium. The stadium is nowhere close to traditional stadiums that are typically embedded with a cyclic running trail. According to the plan, there are $n$ service spots in the stadium, and $m$ undirected running trails connecting them. Such adventurous design has brought worldwide attention to the stadium, but also comes with a huge cost.\u003cbr\u003e\u003cbr\u003eTherefore the designers are working to simplify the design to cut down the cost. They discovered that the easiest way to do this is to sort the $m$ running trails in some particular order, and keep only some consecutive trails in the list. Since only part of the trails will be built, fund will be saved and everyone will be happy --- perhaps except those long-distance runners who needs a cyclic trail for the competition. A cyclic trail is a trail that starts at some service spot, passes through some distinct spots, before getting back to where it starts. All the running trails that have been used are required to be distinct. (This is by definition a \u003cb\u003esimple cycle\u003c/b\u003e if you are familiar with terms in graph theory.)\u003cbr\u003e\u003cbr\u003eYour task is to write a program that can quickly check, whether one can find at least one simple cycle, given that the stadium is built with some particular running trails selected consecutively from the trail list.\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"The first line of the input contains a single integer $T$ ($1\\le T\\le 10$), denoting the number of test cases.\u003cbr\u003e\u003cbr\u003eFor each of the next $T$ cases, the first line contains three space-separated integers $n$, $m$, $q$ ($1\\le n,m,q \\le 3\\cdot 10^5$), denoting the number of service spots, number of running trails in the initial plan, and the number of queries.\u003cbr\u003e\u003cbr\u003eIn the next $m$ lines, the $i$-th line contains two space-separated integers $u_i$, $v_i$ ($1\\le u_i,v_i\\le n$, $u_i\\ne v_i$).\u003cbr\u003e\u003cbr\u003eEach of the next $q$ lines contains two space-separated integers $l\u0027$, $r\u0027$ ($1\\le l\u0027\\le r\u0027\\le m$). $l$ and $r$ can be calculated via the following procedure. \u003cbr\u003e\u003cbr\u003e\u003cul\u003e\u003cbr\u003e\u003cli\u003e Let $\\text{lastans}$ denote the answer to the last query (if the answer is \u0027\u0027Yes\u0027\u0027, $\\text{lastans} \u003d 1$, otherwise $\\text{lastans}\u003d0$) and is initially zero.\u003c/li\u003e\u003cbr\u003e\u003cli\u003e $k_1\u003d(l\u0027\\; \\text{xor}\\; \\text{lastans})\\; \\text{mod}\\; m + 1$.\u003c/li\u003e\u003cbr\u003e\u003cli\u003e $k_2\u003d(r\u0027\\; \\text{xor}\\; \\text{lastans})\\; \\text{mod}\\; m + 1$.\u003c/li\u003e\u003cbr\u003e\u003cli\u003e $l \u003d \\min(k_1, k_2)$.\u003c/li\u003e\u003cbr\u003e\u003cli\u003e $r \u003d \\max(k_1, k_2)$.\u003c/li\u003e\u003cbr\u003e\u003c/ul\u003e\u003cbr\u003e\u003cbr\u003e$l$ and $r$ means the edges in $[l, r]$ will be chosen. That means, for this query, only edges $(u_l, v_l), (u_{l+1}, v_{l+1}), \\ldots, (u_r, v_r)$ are visible.\u003cbr\u003e\u003cbr\u003eIt is guaranteed that $\\sum n,\\sum m \\le 1.5\\cdot 10^6$."}},{"title":"Output","value":{"format":"HTML","content":"For every query, output \u0027\u0027Yes\u0027\u0027 in one line if edges that are chosen forms at least one cyclic trail, otherwise output \u0027\u0027No\u0027\u0027 in one line."}},{"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\u003e1\r\n3 4 3\r\n1 2\r\n1 2\r\n2 3\r\n3 1\r\n1 4\r\n2 3\r\n2 4\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eYes\r\nNo\r\nYes\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}