{"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\"\u003eAfter retired from hustacm, Sempr(Liangjing Wang) find a part-time-job in Snowwolf(Wei Xu)\u0027s wine shop. There are different qualities of wine in the shop, and all of which has a rating describing the qualities. All the ratings are larger than 0 and smaller than 1,000,000. Everyday nearly Q people will go to his shop and buy a bottle of wine because of his kindness. Once a customer want an X qualified rating but there are no such one, Sempr will sell him a better one with the smallest rating. But the boss of the shop is Snowwolf, you know, so if no wine has no more than Y qualified ratings better than the customer\u0027s request, Sempr will say sorry to them. Every morning, Xiangsanzi will send N bottles of different or same qualified wine.\u003cbr\u003e\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"In the first line there is an Integer T(0\u0026lt;T\u0026lt;10), which means the number of test cases in the test file, then followed by T test cases. \u003cbr\u003eFor each test case; \u003cbr\u003eIn the first line, there are 3 Integers, N,Q and Y. \u003cbr\u003eIn the second line, there are N integers, which means the quality rating of each bottle of wines. \u003cbr\u003eIn the third line, there are Q integers, which means the requests of customers from dawn to dark. \u003cbr\u003eHere, all the Integers are between 0 and 1,000,000 \u003cbr\u003e"}},{"title":"Output","value":{"format":"HTML","content":"For each test case, output \"Case I:\", where I is the case number, then followed by Q different lines of integers, means the quality of wine Sempr will sell that time. If he could not sell any wine, just output -1.\u003cbr\u003e"}},{"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\n2 3 3\r\n2 3\r\n1 2 3\r\n2 3 0\r\n2 3\r\n3 1 2\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eCase 1:\r\n2\r\n3\r\n-1\r\nCase 2:\r\n3\r\n-1\r\n2\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}