I Wanna Become A 24-Point Master
TimeLimit: 2000/1000 MS (Java/Others) MemoryLimit: 65536/65536 K (Java/Others)
64-bit integer IO format:%I64d
Problem Description
Recently Rikka falls in love with an old but interesting game -- 24 points. She wants to become a master of this game, so she asks Yuta to give her some problems to practice.
Quickly, Rikka solved almost all of the problems but the remained one is really difficult:
In this problem, you need to write a program which can get 24 points with n numbers, which are all equal to n.
Input
There are no more then 100 testcases and there are no more then 5 testcases with n≥100. Each testcase contains only one integer n (1≤n≤105)
Output
For each testcase:
If there is not any way to get 24 points, print a single line with -1.
Otherwise, let A be an array with 2n-1 numbers and at firsrt A_i=n (1≤i≤n). You need to print n-1 lines and the i-th line contains one integer a, one char b and then one integer c, where 1≤a,c< n+i and b is "+","-","*" or "/". This line means that you let Aa and Ac do the operation b and store the answer into An+i.
If your answer satisfies the following rule, we think your answer is right:
1. A2n−1=24
2. Each position of the array A is used at most one tine.
3. The absolute value of the numerator and denominator of each element in array A is no more than 10^9