{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"\u003chtml\u003e\n \u003chead\u003e\u003c/head\u003e\n \u003cbody\u003e\n \u003cp\u003e有一个1到N的自然数序列1,2,3,...,N-1,N。\u003c/p\u003e \n \u003cp\u003e我们对它进行M次操作,每次操作将其中连续的一段区间 $ [Ai , Bi] $ (即第Ai个元素到第Bi个元素之间的一段)取出,然后插入到剩下的第Ci个元素的后面,如果Ci\u003d0,表示插入到最左端。\u003c/p\u003e \n \u003cp\u003e现在,M次操作完后,有K个询问,每个询问Pi表示询问最终第Pi个元素是几。你的任务是写一个程序,依次回答这K个询问。\u003c/p\u003e\n \u003c/body\u003e\n\u003c/html\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003chtml\u003e\n \u003chead\u003e\u003c/head\u003e\n \u003cbody\u003e\n \u003cp\u003e第一行三个数,N,M,K。\u003c/p\u003e \n \u003cp\u003e接下来M行,每行三个整数Ai,Bi,Ci。\u003c/p\u003e \n \u003cp\u003e接下来K行,每行一个正整数Pi。\u003c/p\u003e \n \u003cp\u003e1\u0026lt;\u003dN\u0026lt;\u003d\u003cspan class\u003d\"math inline\"\u003e10\u003csup\u003e9\u003c/sup\u003e\u003c/span\u003e,1\u0026lt;\u003dM\u0026lt;\u003d\u003cspan class\u003d\"math inline\"\u003e10\u003csup\u003e4\u003c/sup\u003e\u003c/span\u003e,1\u0026lt;\u003dK\u0026lt;\u003d1000,1\u0026lt;\u003dAi\u0026lt;\u003dBi\u0026lt;\u003dN,0\u0026lt;\u003dCi\u0026lt;\u003dN-(Bi-Ai+1),1\u0026lt;\u003dPi\u0026lt;\u003dN;\u003c/p\u003e\n \u003c/body\u003e\n\u003c/html\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003chtml\u003e\n \u003chead\u003e\u003c/head\u003e\n \u003cbody\u003e\n \u003cp\u003e输出共K行,为每次询问的答案。\u003c/p\u003e\n \u003c/body\u003e\n\u003c/html\u003e"}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003cpre\u003e13 3 13 \n6 12 1 \n2 9 0 \n10 13 8 \n1 \n2 \n3 \n4 \n5 \n6 \n7 \n8 \n9 \n10 \n11 \n12 \n13\n\n\n\u003c/pre\u003e"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003cpre\u003e6 \n7 \n8 \n9 \n10 \n11 \n12\n2 \n3 \n4 \n5 \n13 \n1 \n\u003c/pre\u003e"}},{"title":"Hint","value":{"format":"HTML","content":"\u003chtml\u003e\n \u003chead\u003e\u003c/head\u003e\n \u003cbody\u003e\u003c/body\u003e\n\u003c/html\u003e"}}]}