{"trustable":false,"prependHtml":"\u003cstyle type\u003d\u0027text/css\u0027\u003e\n .input, .output {\n border: 1px solid #888888;\n }\n .output {\n margin-bottom: 1em;\n position: relative;\n top: -1px;\n }\n .output pre, .input pre {\n background-color: #EFEFEF;\n line-height: 1.25em;\n margin: 0;\n padding: 0.25em;\n }\n \u003c/style\u003e\n \u003clink rel\u003d\"stylesheet\" href\u003d\"//codeforces.org/s/96598/css/problem-statement.css\" type\u003d\"text/css\" /\u003e\n\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027$$$$$$\u0027, right: \u0027$$$$$$\u0027, display: true},\n {left: \u0027$$$\u0027, right: \u0027$$$\u0027, display: false},\n {left: \u0027$$\u0027, right: \u0027$$\u0027, display: true},\n {left: \u0027$\u0027, right: \u0027$\u0027, display: false}\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"题意","value":{"format":"HTML","content":"\u003c/p\u003e\u003cp\u003e给定数组$$$a_1,a_2,\\ldots, a_n$$$和$$$b_1,b_2,\\ldots, b_n$$$,需要通过以下的操作将数组$$$a$$$变为数组$$$b$$$。\u003c/p\u003e\u003cp\u003e有$$$m$$$种操作。每种操作都有一个属性$$$x$$$,并且最多只能使用一次。一次操作是:\u003c/p\u003e\u003cul\u003e \u003cli\u003e 选择任何之前未使用过的操作,其属性为$$$x$$$; \u003c/li\u003e\u003cli\u003e 选择一段$$$[l,r]$$$($$$1\\leq l \\leq r \\leq n$$$); \u003c/li\u003e\u003cli\u003e 对每个$$$l\\leq i \\leq r$$$将$$$a_i$$$赋值为$$$\\min (a_i,x)$$$; \u003c/li\u003e\u003c/ul\u003e\u003cp\u003e注意,一些操作可能有相同的属性。\u003c/p\u003e\u003cp\u003e你可以进行尽可能多的操作,只要每种操作最多使用一次,并且最终对于每个$$$1 \\leq i \\leq n$$$都满足$$$a_i \u003d b_i$$$。你不一定要使用所有的操作。\u003c/p\u003e\u003cp\u003e你需要确定是否能通过这些操作将数组$$$a$$$变为数组$$$b$$$。\u003c/p\u003e"}},{"title":"输入","value":{"format":"HTML","content":"\u003cp\u003e每个测试包含多个测试用例。第一行包含测试用例的数量$$$t$$$($$$1 \\leq t \\leq 20\\,000$$$)。接下来是测试用例的描述。\u003c/p\u003e\u003cp\u003e每个测试用例的第一行包含一个正整数$$$n$$$($$$3\\leq n\\leq 2\\cdot 10^5$$$) — 数组$$$a$$$和$$$b$$$的长度。\u003c/p\u003e\u003cp\u003e每个测试用例的第二行包含$$$n$$$个正整数$$$a_1, a_2, \\ldots, a_n$$$($$$1 \\leq a_i \\leq 10^9$$$) 。\u003c/p\u003e\u003cp\u003e每个测试用例的第三行包含$$$n$$$个正整数$$$b_1, b_2, \\ldots, b_n$$$($$$1 \\leq b_i \\leq 10^9$$$)。\u003c/p\u003e\u003cp\u003e每个测试用例的第四行包含一个正整数$$$m$$$($$$1 \\leq m \\leq 2\\cdot 10^5$$$) — 操作的数量。\u003c/p\u003e\u003cp\u003e每个测试用例的第五行包含$$$m$$$个正整数$$$x_1,x_2, \\ldots, x_m$$$($$$1 \\leq x_i \\leq 10^9$$$) — 操作的属性。\u003c/p\u003e\u003cp\u003e保证$$$n$$$和$$$m$$$的总和不超过$$$2\\cdot 10^5$$$。\u003c/p\u003e"}},{"title":"输出","value":{"format":"HTML","content":"\u003cp\u003e对于每个测试用例,如果能通过这些操作将数组$$$a$$$变为数组$$$b$$$,则打印“\u003cspan class\u003d\"tex-font-style-tt\"\u003eYES\u003c/span\u003e”。否则,打印“\u003cspan class\u003d\"tex-font-style-tt\"\u003eNO\u003c/span\u003e”。\u003c/p\u003e\u003cp\u003e你可以以任何大小写形式输出答案。"}},{"title":"样例","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\u003e7\n3\n3 3 3\n2 1 2\n2\n1 2\n6\n3 4 4 6 3 4\n3 1 2 3 2 3\n3\n3 2 3\n10\n1 2 3 4 5 6 7 8 9 10\n1 2 3 4 5 6 7 8 9 10\n10\n1 2 3 4 5 6 7 8 9 10\n3\n1 1 1\n1 1 2\n12\n4 2 4 3 1 5 6 3 5 6 2 1\n13\n7 9 4 5 3 3 3 6 8 10 3 2 5\n5 3 1 5 3 2 2 5 8 5 1 1 5\n8\n1 5 3 5 4 2 3 1\n13\n7 9 4 5 3 3 3 6 8 10 3 2 5\n5 3 1 5 3 2 2 5 8 5 1 1 5\n7\n1 5 3 4 2 3 1\n3\n19747843 2736467 938578397\n2039844 2039844 2039844\n1\n2039844\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eYES\nNO\nYES\nNO\nYES\nNO\nYES\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e"}},{"title":"说明","value":{"format":"HTML","content":"\u003cp\u003e在第一个测试用例中,$$$a$$$是$$$[3,3,3]$$$。让我们描述一系列操作:\u003c/p\u003e\u003cul\u003e \u003cli\u003e使用属性为$$$1$$$的操作,区间为$$$[2,2]$$$;因此$$$a$$$变成了$$$[3,1,3]$$$。\u003c/li\u003e\u003cli\u003e使用属性为$$$2$$$的操作,区间为$$$[1,3]$$$;因此$$$a$$$变成了$$$b$$$即$$$[2,1,2]$$$。\u003c/li\u003e\u003c/ul\u003e\u003cp\u003e在第三个测试用例中,不需要进行任何操作,因为$$$a$$$已经等于$$$b$$$了。\u003c/p\u003e\u003cp\u003e在第四个测试用例中,没有办法通过操作来增加$$$[1,1,1]$$$中的第三个元素,使得$$$a$$$变成$$$[1,1,2]$$$。\u003c/p\u003e"}}]}