#P12904. [NERC 2020] Equilibrium Point /\/\

    ID: 12721 远端评测题 3000ms 512MiB 尝试: 0 已通过: 0 难度: 8 上传者: 标签>计算几何2020Special JudgeICPC折半搜索 meet in the middleNERC/NEERC

[NERC 2020] Equilibrium Point /\/\

Description

Consider a balanced bracket sequence ss with one type of brackets: (\tt{(} and )\tt{)}.

There is a common geometrical representation of such a sequence. Starting at the point (0,0)(0, 0), you draw a polyline, for each bracket moving along a vector (1,1)(1, 1) if it is an opening bracket, and along (1,1)(1, -1) if it is a closing bracket.

Consider an area between this curve and the line y=0y=0. It is a set of polygons. This area has its center of mass at some point (x,y)(x, y). Note that the center of mass might be outside of the area.

You are to solve the reverse problem. Given the length nn and a point (x,y)(x, y), find any balanced bracket sequence of length nn such that the center of mass of its geometrical representation is located at (x,y)(x, y).

Input Format

The first line contains three numbers nn, xx, and yy (nn is an even integer, 2n362 \le n \le 36; 0<x,y<n0 < x, y < n) --- the length of the desired sequence and the coordinates of the desired center of mass.

It is guaranteed that (x,y)(x, y) is the center of mass of some balanced bracket sequence of length nn, with Euclidean-distance error of no more than 10910^{-9}.

Output Format

Output a balanced bracket sequence with brackets (\tt{(} and )\tt{)} of length nn such that the center of mass of its geometrical representation is located at the point (x,y)(x, y), with Euclidean-distance error of no more than 10710^{-7}.

6 3.4 0.6
()(())