{"raw_statement":[{"iden":"statement","content":"A bracket sequence is a string containing only characters \"_(_\" and \"_)_\". A regular bracket sequence is a bracket sequence that can be transformed into a correct arithmetic expression by inserting characters \"_1_\" and \"_+_\" between the original characters of the sequence. For example, bracket sequences \"_()()_\" and \"_(())_\" are regular (the resulting expressions are: \"_(1)+(1)_\" and \"_((1+1)+1)_\"), and \"_)(_\", \"_(_\" and \"_)_\" are not.\n\n_Subsequence is a sequence that can be derived from another sequence by deleting some elements without changing the order of the remaining elements._\n\nYou are given a regular bracket sequence $s$ and an integer number $k$. Your task is to find a regular bracket sequence of length exactly $k$ such that it is also a subsequence of $s$.\n\nIt is guaranteed that such sequence always exists."},{"iden":"input","content":"The first line contains two integers $n$ and $k$ ($2 \\le k \\le n \\le 2 \\cdot 10^5$, both $n$ and $k$ are even) — the length of $s$ and the length of the sequence you are asked to find.\n\nThe second line is a string $s$ — regular bracket sequence of length $n$."},{"iden":"output","content":"Print a single string — a regular bracket sequence of length exactly $k$ such that it is also a subsequence of $s$.\n\nIt is guaranteed that such sequence always exists."},{"iden":"examples","content":"Input\n\n6 4\n()(())\n\nOutput\n\n()()\n\nInput\n\n8 8\n(()(()))\n\nOutput\n\n(()(()))"}],"translated_statement":[{"iden":"statement","content":"括号序列是仅包含字符 \"_(_\" 和 \"_)_\" 的字符串。正则括号序列是指可以通过在原序列的字符之间插入字符 \"_1_\" 和 \"_+_\" 转换为正确算术表达式的括号序列。例如，括号序列 \"_()()_\" 和 \"_(())_\" 是正则的（对应的表达式分别为 \"_(1)+(1)_\" 和 \"_((1+1)+1)_\"），而 \"_)(_\"、\"_(_\" 和 \"_)_\" 则不是。\n\n_子序列是从另一个序列中删除某些元素而不改变剩余元素顺序所得到的序列。_\n\n给定一个正则括号序列 $s$ 和一个整数 $k$，你的任务是找到一个长度恰好为 $k$ 的正则括号序列，且它是 $s$ 的子序列。\n\n题目保证这样的序列一定存在。\n\n第一行包含两个整数 $n$ 和 $k$（$2 lt.eq k lt.eq n lt.eq 2 dot.op 10^5$，且 $n$ 和 $k$ 均为偶数）——分别表示 $s$ 的长度和你需要找到的序列的长度。\n\n第二行是一个字符串 $s$——长度为 $n$ 的正则括号序列。\n\n请输出一个字符串——一个长度恰好为 $k$ 的正则括号序列，且它是 $s$ 的子序列。\n\n题目保证这样的序列一定存在。\n\n"},{"iden":"input","content":"第一行包含两个整数 $n$ 和 $k$（$2 lt.eq k lt.eq n lt.eq 2 dot.op 10^5$，且 $n$ 和 $k$ 均为偶数）——分别表示 $s$ 的长度和你需要找到的序列的长度。第二行是一个字符串 $s$——长度为 $n$ 的正则括号序列。"},{"iden":"output","content":"请输出一个字符串——一个长度恰好为 $k$ 的正则括号序列，且它是 $s$ 的子序列。题目保证这样的序列一定存在。"},{"iden":"examples","content":"输入\n6 4\n()(())\n输出\n()()\n\n输入\n8 8\n(()(()))\n输出\n(()(()))"}],"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ n, k \\in \\mathbb{Z} $ be even integers such that $ 2 \\leq k \\leq n \\leq 2 \\cdot 10^5 $.  \nLet $ s \\in \\{ (, ) \\}^n $ be a regular bracket sequence of length $ n $.  \n\nA *bracket sequence* is a string over the alphabet $ \\{ (, ) \\} $.  \nA *regular bracket sequence* is a bracket sequence that is balanced (equal number of opening and closing brackets, and every prefix has at least as many opening as closing brackets).  \n\nA *subsequence* of $ s $ is a sequence obtained by deleting zero or more characters from $ s $ without changing the order of the remaining characters.  \n\n**Constraints**  \n1. $ n, k $ are even.  \n2. $ s $ is a regular bracket sequence of length $ n $.  \n3. $ 2 \\leq k \\leq n $.  \n\n**Objective**  \nFind a regular bracket sequence $ t \\in \\{ (, ) \\}^k $ such that $ t $ is a subsequence of $ s $.  \n\n**Output**  \nOutput any such $ t $.","simple_statement":null,"has_page_source":false}