{"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":"HTML","content":"对于一个仅由 ()? 三种字符组成的字符串,你可以把其中的每个问号替换成一个括号(不同的问号可以替换成不同的括号),问能否将其变成一个合法的括号序列。"}},{"title":"Input","value":{"format":"HTML","content":"第一行,一个整数 t (1 \u003c\u003d t \u003c\u003d 1000),表示数据组数。\n下面每行一个字符串(长度不超过100),只包含()?三种字符。"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003eFor each test case, print \u003cspan class\u003d\"tex-font-style-tt\"\u003eYES\u003c/span\u003e if it is possible to obtain a regular bracket sequence, or \u003cspan class\u003d\"tex-font-style-tt\"\u003eNO\u003c/span\u003e otherwise}. \u003c/p\u003e\n\u003cp\u003eYou may print each letter in any case (for example, \u003cspan class\u003d\"tex-font-style-tt\"\u003eYES\u003c/span\u003e, \u003cspan class\u003d\"tex-font-style-tt\"\u003eYes\u003c/span\u003e, \u003cspan class\u003d\"tex-font-style-tt\"\u003eyes\u003c/span\u003e, \u003cspan class\u003d\"tex-font-style-tt\"\u003eyEs\u003c/span\u003e will all be recognized as positive answer).\u003c/p\u003e"}},{"title":"Example","value":{"format":"HTML","content":"\u003cdiv class\u003d\"sample-test\"\u003e\n \u003cdiv class\u003d\"input\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Input\n \u003c/div\u003e\n \u003cpre\u003e5\n()\n(?)\n(??)\n??()\n)?(?\n\u003c/pre\u003e\n \u003c/div\u003e\n \u003cdiv class\u003d\"output\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Output\n \u003c/div\u003e\n \u003cpre\u003eYES\nNO\nYES\nYES\nNO\n\u003c/pre\u003e\n \u003c/div\u003e\n\u003c/div\u003e"}},{"title":"Note","value":{"format":"HTML","content":"\u003cp\u003eIn the first test case, the sequence is already an RBS.\u003c/p\u003e\n\u003cp\u003eIn the third test case, you can obtain an RBS as follows: \u003cspan class\u003d\"tex-font-style-tt\"\u003e()()\u003c/span\u003e or \u003cspan class\u003d\"tex-font-style-tt\"\u003e(())\u003c/span\u003e.\u003c/p\u003e\n\u003cp\u003eIn the fourth test case, you can obtain an RBS as follows: \u003cspan class\u003d\"tex-font-style-tt\"\u003e()()\u003c/span\u003e.\u003c/p\u003e"}}]}