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
SampleInput
4
SampleOutput
1 * 2
5 + 3
6 + 4
Submit
题目统计信息详细
总AC数3
通过人数3
尝试人数4
总提交量10
AC率30.00%
AC该题后可以添加标签
贴完标签可以获得20ACB。
并且可以获得本题所有提交代码查看权限。
点击标题可以显示标签。
如果你还没认真思考过这题,请不要查看标签
如果您已经通过了该题,请务为该题贴上标签

T^T Online Judge

[BUG反馈] [FAQ] [闽ICP备17026590号-1]
当前版本:3.24 系统时间: