{"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\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 type\u003d\"text/javascript\" async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS_HTML-full\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"MD","content":"波利卡普建立了自己的网络服务。作为一种现代网络服务,它包括登录功能。而这总是意味着密码安全问题。\n\nPolycarp 决定存储由以下算法生成的密码哈希值:\n\n1. 获取由小写拉丁字母组成的密码 $p$ ,然后随机洗码,得到 $p\u0027$ ( $p\u0027$ 仍然可以等于 $p$ );\n生成两个由小写拉丁字母组成的随机字符串 $s_1$ 和 $s_2$ }(其中任何一个字符串都可以为空);\n3. 生成哈希值 $h \u003d s_1 + p\u0027 + s_2$ ,这里的加法就是字符串连接。\n\n例如,让密码 $p \u003d$ \"abacaba\"。那么 $p\u0027$ 可以等于 \"aabcaab\"。随机字符串 $s1 \u003d$ \"zyx \"和 $s2 \u003d$ \"kjh\"。那么 $h \u003d$ \"zyxaabcaabkjh\"。\n\n请注意,不能在 $p$ 中删除或添加任何字母来得到 $p\u0027$ ,只能改变顺序。\n\n现在,波利卡普请你帮助他实现密码检查模块。给定密码 $p$ 和哈希值 $h$ ,检查 $h$ 是否可以作为密码 $p$ 的哈希值。\n\n您的程序应回答 $t$ 个独立的测试用例。"}},{"title":"Input","value":{"format":"MD","content":"**输入**\n\n第一行包含一个整数 $t$ ( $1 \\le t \\le 100$ ) - 测试用例的数量。\n\n每个测试用例的第一行包含一个非空字符串 $p$ ,由小写拉丁字母组成。 $p$ 的长度不超过 $100$ 。\n\n每个测试用例的第二行包含一个非空字符串 $h$ ,由小写拉丁字母组成。 $h$ 的长度不超过 $100$ 。"}},{"title":"Output","value":{"format":"MD","content":"**输出**\n\n打印每个测试用例的答案--如果可以通过给定密码 $p$ 获取给定哈希值 $h$ 则为 \"是\",否则为 \"否\"。"}},{"title":"Sample 1","value":{"format":"MD","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\u003e5\nabacaba\nzyxaabcaabkjh\nonetwothree\nthreetwoone\none\nzzonneyy\none\nnone\ntwenty\nten\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eYES\nYES\nNO\nYES\nNO\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Note","value":{"format":"MD","content":"**注**\n\n第一个测试案例已在声明中说明。\n\n在第二个测试用例中, $s_1$ 和 $s_2$ 都是空的,而 $p\u0027\u003d$ }\"threetwoone \"被 $p$ 洗牌。\n\n在第三个测试案例中,无法从密码中获取哈希值。\n\n在第四个测试案例中, $s_1\u003d$ \"nn\", $s_2$ 为空, $p\u0027\u003d$ 为 \"one\"。1 \"被 $p$ 洗牌(尽管它保持不变)。\n\n在第五个测试案例中,无法从密码中获取哈希值。"}}]}