시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 512 MB43375.000%

문제

Perhaps you are familiar with the problem of finding $k$-th order statistic in an array. Problem is to find out what number is at position $k$, if all numbers are sorted in ascending order. For example, the $2$-nd order statistic from the numbers $[10, 2, 5]$ is $5$, and $n$-th order statistic is always equal to the maximum of $n$ numbers.

In this task, you need to come up with an expression that computes the $k$-th order statistic of $n$ different positive integers using only the arithmetic operations "+", "-", "*", "/", the function returning the absolute value of the number abs, the variables named with the first $n$ lowercase letters of the Latin alphabet, starting with a, and also any integers not exceeding $10^9$ by absolute value. You can use the unary minus, but you can not use the unary plus. Also, the expression can not contain any whitespace characters.

Verification of your expression will be conducted as follows: for each test, a certain number of sets of values of $n$ variables are generated. These sets are determined before the start of the competition and are the same for all solutions of all participants. All values of variables are positive, different and do not exceed $1000$.

The solution will be considered correct if the evaluation of the expression printed by your program gives the correct result for all selected sets of variables. All calculations are performed from left to right, but taking into account the priorities of the operators. The unary minus has the biggest priority. The operators "*" and "/" have the same priority, less than the unary minus, and operators "+" and "-" have the same priority, less than all of the above. For all generated sets of variables, your expression can not divide by zero, and all intermediate calculations must be integers from $-10^9$ to $10^9$.

입력

The only line contains two integers $n$ and $k$ ($1 \le k \le n \le 26$).

출력

Output one line containing an expression that computes the $k$-th order statistics from $n$ given variables. The length of the expression should not exceed $10^5$. If there are several different correct expressions, you can print any of those.

서브태스크

번호배점제한
117

$n \le 3$

232

$n \le 5$

327

$n \le 12$

424

$n \le 26$

예제 입력 1

2 1

예제 출력 1

abs(-a+b+(a*a-b*b)/abs(b-a))/2

힌트

In the first example you need to create an expression which evaluates the minimum of $a$ and $b$. Let's show the result of evaluation for different values of $a$ and $b$:

  • $a = 3$, $b = 5$. Result is $\frac 12 |-3+5+\frac{9-25}{|3-5|}|$ = $\frac{|5-3-8|}2$ = $\frac{|-6|}2$ = $3$ = $a$ = $\min(a, b)$.
  • $a = 5$, $b = 2$. Result is $\frac 12 |-5+2+\frac{25-4}{|5-2|}|$ = $\frac{|-5+2+7|}2$ = $\frac{|4|}2$ = $2$, which equals also to $\min(a, b)$.

채점 및 기타 정보

  • 예제는 채점하지 않는다.