Pro.ID21756 TitleArrays Title链接http://10.20.2.8/oj/exercise/problem?problem_id=21756 AC0 Submit0 Ratio- 时间&空间限制描述You are given a sequence of 3*N integers ( X1, X2, ... , X3*n). Create three sequences ( A1, A2, ... , AN ), ( B1, B2, ..., BN ) and ( C1, C2, ..., CN ) such that:
输入The input file contains T test cases, all having the same value of N. The first line of the input file contains the integers T and N, constrained as shown in the adjacent table. Each of the following T lines describes one test case and contains 3*N integers, the members of the sequence X. All these values are in the range from 0 to 1000. Constraints on N Constraints on T 1 ≤ N ≤ 10 1 ≤ T ≤ 1000 11 ≤ N ≤ 15 1 ≤ T ≤ 100 16 ≤ N ≤ 20 1 ≤ T ≤ 10 21 ≤ N ≤ 25 T = 1 输出Description You are given a sequence of 3*N integers ( X1, X2, ... , X3*n). Create three sequences ( A1, A2, ... , AN ), ( B1, B2, ..., BN ) and ( C1, C2, ..., CN ) such that:
Input The input file contains T test cases, all having the same value of N. The first line of the input file contains the integers T and N, constrained as shown in the adjacent table. Each of the following T lines describes one test case and contains 3*N integers, the members of the sequence X. All these values are in the range from 0 to 1000. Constraints on N Constraints on T 1 ≤ N ≤ 10 1 ≤ T ≤ 1000 11 ≤ N ≤ 15 1 ≤ T ≤ 100 16 ≤ N ≤ 20 1 ≤ T ≤ 10 21 ≤ N ≤ 25 T = 1 Output The output file should consist of T lines. Each line should contain the largest possible value of S for the corresponding test case from the input file. Sample Input 1 2 Sample Output 46 Hint Note. The maximal value is attained by taking A = (1, 3), B = (2, 5), C = (4, 6). Source 样例输入1 2 样例输出46 提示Note. The maximal value is attained by taking A = (1, 3), B = (2, 5), C = (4, 6). |