Java 两个整数数组之间的计算
我有一个随机生成的整数数组(A1),其中包括以下特性Java 两个整数数组之间的计算,java,arrays,Java,Arrays,我有一个随机生成的整数数组(A1),其中包括以下特性 数组长度为4 元素由1到9的整数值填充 没有重复的值 按升序排列 现在还有另一个数组(A2),它是A1的降序数组。 我计划做的是,在这两个数组之间获得所有可能的线性和交叉计算(仅添加)。 起始数组可以是A1或A2,但应始终以第零个元素开始。 A1或A2中的值可采用正或负形式进行计算。 应按数组索引的递增顺序从数组中选取值 示例:1 示例:2 示例:3 示例:4 起初,我一直试图通过仅使用for循环来实现这一点,但后来我对其应用了递归。
我计划做的是,在这两个数组之间获得所有可能的线性和交叉计算(仅添加)。
起始数组可以是A1或A2,但应始终以第零个元素开始。
A1或A2中的值可采用正或负形式进行计算。
应按数组索引的递增顺序从数组中选取值 示例:1 示例:2 示例:3
示例:4
起初,我一直试图通过仅使用for循环来实现这一点,但后来我对其应用了递归。但是,它只适用于一个或两个值的计算。有什么有效的方法可以做到这一点吗? 希望我的问题足够清楚 已编辑 让我们看一下
A1=[1,2,3,4]
A2=[4,3,2,1]那么可能的计算结果应该如下
2、-4、6、2、7、1、-2、-6、-1、-7,
6,0,5,1,2,4,1,3,7,1,
6,2,1,-5,0,-4,4,-2,3,-1,
0,-6,-1,-5,5,-1,4,0,-1,-7,
-2、-6、9、3、8、4、5、-1、4、0、
10,4,9,5,4,-2,3,-1,1,-5,
0,-4,-3,-9,-4,-8,2,-4,1,-3,
-4、-10、-5、-9、10、2、7、5、4、-4,
1,-1,9,1,6,4,5,-3,2,0,
6、-2、3、1、0、-8、-3、-5、5、-3,
2,0,1,7,2,4,11,3,8,6,
5,-3,2,0,10,2,7,5,6,-2,
3,1,5,-3,2,0,-1,-9,-4,-6,
4、-4、1、-1、0、-8、-3、-5、8、0、
5,3,2,-6,-1,-3,7,-1,4,2,
3、-5、0、-2、4、-4、1、-1、-2、-10,
-5、-7、3、-5、0、-2、-1、-9、-4、-6、
9,1,6,4,3,-5,0,-2,8,0,
5,3,4,-4,1,-1,3,-5,0,-2,
-3、-11、-6、-8、2、-6、-1、-3、-2、-10,
-5、-7、13、5、10、8、7、-1、4、2、
12,4,9,7,8,0,5,3,9,1,
6,4,3,-5,0,-2,8,0,5,3,
4、-4、1、-1、14、6、11、9、8、0、
5,3,13,5,10,8,9,1,6,4,
8,0,5,3,2,-6,-1,-3,7,-1,
4,2,3,-5,0,-2,5,-3,2,0,
-1、-9、-4、-6、4、-4、1、-1、0、-8、
-3、-5、1、-7、-2、-4、-5、-13、-8、-10,
0、-8、-3、-5、-4、-12、-7、-9、6、-2、
3,1,0,-8,-3,-5,5,-3,2,0,
1、-7、-2、-4、0、-8、-3、-5、-6、-14、
-9、-11、-1、-9、-4、-6、-5、-13、-8、-10、类似的东西
public class Test {
public static void main(String[] args) {
Test test = new Test();
System.out.println(Arrays.toString(test.A1));
System.out.println(Arrays.toString(test.A2));
System.out.println(test.result);
}
private int[] A1, A2;
private List<Integer> result;
private Test() {
List<Integer> digits = new ArrayList<>(Arrays.asList(1,2,3,4,5,6,7,8,9));
Random random = new Random();
this.A1 = new int[4];
for (int i = 0; i < this.A1.length; i++) {
int idx = random.nextInt(digits.size());
this.A1[i] = digits.remove(idx);
}
Arrays.sort(this.A1);
this.A2 = new int[this.A1.length];
for (int i = 0; i < this.A1.length; i++)
this.A2[i] = this.A1[this.A1.length - i - 1];
this.result = new ArrayList<>();
for (int i = 0; i < this.A1.length; i++)
calc(i, 0);
}
private void calc(int idx, int sum) {
add(sum + this.A1[idx], idx + 1);
add(sum - this.A1[idx], idx + 1);
add(sum + this.A2[idx], idx + 1);
add(sum - this.A2[idx], idx + 1);
}
private void add(int sum, int nextIdx) {
this.result.add(sum);
if (nextIdx < this.A1.length)
calc(nextIdx, sum);
}
}
更新 由于您表示希望对公式进行编号和打印,因此这里是一个非递归实现,它使用位模式选择要汇总的每一个1/4部分 请注意,以前的实现和新实现都返回448个组合,而不是您提到的340个组合 代码构建了所有组合的列表。然后,您可以选择对列表进行排序(如按组合长度排序),以及是要收集总和,还是打印文本公式或数字公式
public class Combo {
public static void main(String[] args) {
int[] A1 = { 1, 2, 3, 4 };
int[] A2 = { 4, 3, 2, 1 };
List<Combo> comboList = new ArrayList<>();
for (int start = 0; start < A1.length; start++)
for (int end = start; end < A1.length; end++) {
final int combinations = 1 << ((end - start + 1) << 1); // 4 ^ (end - start + 1)
for (int combo = 0; combo < combinations; combo++)
comboList.add(new Combo(start, end, combo));
}
Collections.sort(comboList, (c1, c2) -> Integer.compare(c1.end - c1.start, c2.end - c2.start));
for (int i = 0; i < comboList.size(); i++) {
Combo combo = comboList.get(i);
System.out.printf("%3d: %-33s = %-17s = %d%n", i + 1, combo.getTextFormula(),
combo.getNumberFormula(A1, A2), combo.getSum(A1, A2));
}
}
private final int start;
private final int end;
private final int combo;
public Combo(int start, int end, int combo) {
this.start = start;
this.end = end;
this.combo = combo;
}
private String getTextFormula() {
StringBuilder buf = new StringBuilder();
for (int i = this.start; i <= this.end; i++) {
int c = this.combo >> ((this.end - i) << 1) & 3;
if (i != this.start) buf.append(" + ");
buf.append(c == 0 ? "A1" : c == 1 ? "-A1" : c == 2 ? "A2" : "-A2").append('[').append(i).append(']');
}
return buf.toString();
}
private String getNumberFormula(int[] A1, int[] A2) {
StringBuilder buf = new StringBuilder();
for (int i = this.start; i <= this.end; i++) {
int c = this.combo >> ((this.end - i) << 1) & 3;
if (i != this.start) buf.append(" + ");
buf.append(c == 0 ? A1[i] : c == 1 ? -A1[i] : c == 2 ? A2[i] : -A2[i]);
}
return buf.toString();
}
private int getSum(int[] A1, int[] A2) {
int sum = 0;
for (int i = this.start; i <= this.end; i++) {
int c = this.combo >> ((this.end - i) << 1) & 3;
sum += (c == 0 ? A1[i] : c == 1 ? -A1[i] : c == 2 ? A2[i] : -A2[i]);
}
return sum;
}
}
以下是我可以为你写的: 资料来源:
我不理解您希望找到所有添加解决方案的要求,以及它们如何引用您提供的示例。向我们展示您的代码尝试并在此基础上解释您遇到的问题也是一种很好的形式。您的预期输出是什么?只是计算的结果,例如16个数字,例如#1?@Andreas-是的!您的代码可以完成此任务。:)是的,这是我一直在寻找的结果。我知道你递归地使用了两种方法。我只使用了一种方法。我想我错估了可能性。尽管
1: A1[0] = 1 = 1
2: -A1[0] = -1 = -1
3: A2[0] = 4 = 4
4: -A2[0] = -4 = -4
5: A1[1] = 2 = 2
6: -A1[1] = -2 = -2
7: A2[1] = 3 = 3
8: -A2[1] = -3 = -3
9: A1[2] = 3 = 3
10: -A1[2] = -3 = -3
11: A2[2] = 2 = 2
12: -A2[2] = -2 = -2
13: A1[3] = 4 = 4
14: -A1[3] = -4 = -4
15: A2[3] = 1 = 1
16: -A2[3] = -1 = -1
17: A1[0] + A1[1] = 1 + 2 = 3
18: A1[0] + -A1[1] = 1 + -2 = -1
. . .
63: -A2[2] + A2[3] = -2 + 1 = -1
64: -A2[2] + -A2[3] = -2 + -1 = -3
65: A1[0] + A1[1] + A1[2] = 1 + 2 + 3 = 6
66: A1[0] + A1[1] + -A1[2] = 1 + 2 + -3 = 0
. . .
127: -A2[0] + -A2[1] + A2[2] = -4 + -3 + 2 = -5
128: -A2[0] + -A2[1] + -A2[2] = -4 + -3 + -2 = -9
129: A1[1] + A1[2] + A1[3] = 2 + 3 + 4 = 9
130: A1[1] + A1[2] + -A1[3] = 2 + 3 + -4 = 1
. . .
191: -A2[1] + -A2[2] + A2[3] = -3 + -2 + 1 = -4
192: -A2[1] + -A2[2] + -A2[3] = -3 + -2 + -1 = -6
193: A1[0] + A1[1] + A1[2] + A1[3] = 1 + 2 + 3 + 4 = 10
194: A1[0] + A1[1] + A1[2] + -A1[3] = 1 + 2 + 3 + -4 = 2
. . .
255: A1[0] + -A2[1] + -A2[2] + A2[3] = 1 + -3 + -2 + 1 = -3
256: A1[0] + -A2[1] + -A2[2] + -A2[3] = 1 + -3 + -2 + -1 = -5
257: -A1[0] + A1[1] + A1[2] + A1[3] = -1 + 2 + 3 + 4 = 8
258: -A1[0] + A1[1] + A1[2] + -A1[3] = -1 + 2 + 3 + -4 = 0
. . .
319: -A1[0] + -A2[1] + -A2[2] + A2[3] = -1 + -3 + -2 + 1 = -5
320: -A1[0] + -A2[1] + -A2[2] + -A2[3] = -1 + -3 + -2 + -1 = -7
321: A2[0] + A1[1] + A1[2] + A1[3] = 4 + 2 + 3 + 4 = 13
322: A2[0] + A1[1] + A1[2] + -A1[3] = 4 + 2 + 3 + -4 = 5
. . .
383: A2[0] + -A2[1] + -A2[2] + A2[3] = 4 + -3 + -2 + 1 = 0
384: A2[0] + -A2[1] + -A2[2] + -A2[3] = 4 + -3 + -2 + -1 = -2
385: -A2[0] + A1[1] + A1[2] + A1[3] = -4 + 2 + 3 + 4 = 5
386: -A2[0] + A1[1] + A1[2] + -A1[3] = -4 + 2 + 3 + -4 = -3
. . .
440: -A2[0] + -A2[1] + -A1[2] + -A2[3] = -4 + -3 + -3 + -1 = -11
441: -A2[0] + -A2[1] + A2[2] + A1[3] = -4 + -3 + 2 + 4 = -1
442: -A2[0] + -A2[1] + A2[2] + -A1[3] = -4 + -3 + 2 + -4 = -9
443: -A2[0] + -A2[1] + A2[2] + A2[3] = -4 + -3 + 2 + 1 = -4
444: -A2[0] + -A2[1] + A2[2] + -A2[3] = -4 + -3 + 2 + -1 = -6
445: -A2[0] + -A2[1] + -A2[2] + A1[3] = -4 + -3 + -2 + 4 = -5
446: -A2[0] + -A2[1] + -A2[2] + -A1[3] = -4 + -3 + -2 + -4 = -13
447: -A2[0] + -A2[1] + -A2[2] + A2[3] = -4 + -3 + -2 + 1 = -8
448: -A2[0] + -A2[1] + -A2[2] + -A2[3] = -4 + -3 + -2 + -1 = -10
public static void main(String[] args) {
Holder[] A1 = { new Holder("A1.1", 4), new Holder("A1.2", 2),
new Holder("A1.3", 5), new Holder("A1.4", 6) };
Holder[] A2 = new Holder[A1.length];
for (int i = A1.length - 1; i > -1; i--) {
A2[A2.length - i - 1] = new Holder(("A2." + (A2.length - i)),
A1[i].value);
}
processArrays(A1, A2);
processArrays(A2, A1);
}
static class Holder {
private Holder(String location, int value) {
this.value = value;
this.location = location;
}
private int value;
private String location;
@Override
public String toString() {
return "[" + location + "," + value + "]";
}
}
private static void processArrays(Holder[] a1, Holder[] a2) {
for (int l = a1.length; l > -1; l--) {
List<Holder> holderList = new ArrayList<>();
for (int i = 0; i < l; i++) {
holderList.add(a1[i]);
}
if (l > 0 && l < a2.length) {
List<Holder> a1HolderList = new ArrayList<>();
for (int i = 0; i < l; i++) {
a1HolderList.add(a1[i]);
}
calculateCombinations(a1HolderList);
for (int il = a2.length - l; il > 0; il--) {
List<Holder> totalHolderList = new ArrayList<>(a1HolderList);
for (int ii = l + il - 1; ii >= l; ii--) {
totalHolderList.add(a2[ii]);
}
calculateCombinations(totalHolderList);
}
}
}
}
private static void calculateCombinations(List<Holder> holderList) {
System.out.println();
BitSet bitSet = BitSet.valueOf(new long[] { 0 });
do {
StringBuilder expressionBuilder = new StringBuilder();
StringBuilder valueBuilder = new StringBuilder();
boolean valueAdded = false;
int expressionValue = 0;
for (int i = 0; i < holderList.size(); i++) {
Holder holder = holderList.get(i);
if (valueAdded) {
expressionBuilder.append(" + ");
valueBuilder.append(" + ");
}
expressionBuilder.append("(");
expressionBuilder.append(bitSet.get(i) ? '-' : "");
expressionValue += (bitSet.get(i) ? 0 - holder.value
: holder.value);
expressionBuilder.append(holder.location);
expressionBuilder.append(")");
valueBuilder.append("(");
if (bitSet.get(i)) {
valueBuilder.append("-(");
valueBuilder.append(holder.value);
valueBuilder.append(")");
} else {
valueBuilder.append(holder.value);
}
valueBuilder.append(")");
valueAdded = true;
}
System.out.print(expressionBuilder);
System.out.print("\t=\t");
System.out.print(valueBuilder);
System.out.print("\t=\t");
System.out.println(expressionValue);
bitSet = incrementBitset(bitSet);
} while (bitSet.length() <= holderList.size());
System.out.println();
}
private static BitSet incrementBitset(BitSet bitSet) {
BitSet returnSet = null;
if (bitSet.toLongArray().length == 0) {
returnSet = BitSet.valueOf(new long[] { 1 });
} else {
int integerValue = (int) bitSet.toLongArray()[0];
returnSet = BitSet.valueOf(new long[] { integerValue + 1 });
}
return returnSet;
}
(A1.1) + (A1.2) + (A1.3) = (4) + (2) + (5) = 11
(-A1.1) + (A1.2) + (A1.3) = (-(4)) + (2) + (5) = 3
(A1.1) + (-A1.2) + (A1.3) = (4) + (-(2)) + (5) = 7
(-A1.1) + (-A1.2) + (A1.3) = (-(4)) + (-(2)) + (5) = -1
(A1.1) + (A1.2) + (-A1.3) = (4) + (2) + (-(5)) = 1
(-A1.1) + (A1.2) + (-A1.3) = (-(4)) + (2) + (-(5)) = -7
(A1.1) + (-A1.2) + (-A1.3) = (4) + (-(2)) + (-(5)) = -3
(-A1.1) + (-A1.2) + (-A1.3) = (-(4)) + (-(2)) + (-(5)) = -11
(A1.1) + (A1.2) + (A1.3) + (A2.4) = (4) + (2) + (5) + (4) = 15
(-A1.1) + (A1.2) + (A1.3) + (A2.4) = (-(4)) + (2) + (5) + (4) = 7
(A1.1) + (-A1.2) + (A1.3) + (A2.4) = (4) + (-(2)) + (5) + (4) = 11
(-A1.1) + (-A1.2) + (A1.3) + (A2.4) = (-(4)) + (-(2)) + (5) + (4) = 3
(A1.1) + (A1.2) + (-A1.3) + (A2.4) = (4) + (2) + (-(5)) + (4) = 5
(-A1.1) + (A1.2) + (-A1.3) + (A2.4) = (-(4)) + (2) + (-(5)) + (4) = -3
(A1.1) + (-A1.2) + (-A1.3) + (A2.4) = (4) + (-(2)) + (-(5)) + (4) = 1
(-A1.1) + (-A1.2) + (-A1.3) + (A2.4) = (-(4)) + (-(2)) + (-(5)) + (4) = -7
(A1.1) + (A1.2) + (A1.3) + (-A2.4) = (4) + (2) + (5) + (-(4)) = 7
(-A1.1) + (A1.2) + (A1.3) + (-A2.4) = (-(4)) + (2) + (5) + (-(4)) = -1
(A1.1) + (-A1.2) + (A1.3) + (-A2.4) = (4) + (-(2)) + (5) + (-(4)) = 3
(-A1.1) + (-A1.2) + (A1.3) + (-A2.4) = (-(4)) + (-(2)) + (5) + (-(4)) = -5
(A1.1) + (A1.2) + (-A1.3) + (-A2.4) = (4) + (2) + (-(5)) + (-(4)) = -3
(-A1.1) + (A1.2) + (-A1.3) + (-A2.4) = (-(4)) + (2) + (-(5)) + (-(4)) = -11
(A1.1) + (-A1.2) + (-A1.3) + (-A2.4) = (4) + (-(2)) + (-(5)) + (-(4)) = -7
(-A1.1) + (-A1.2) + (-A1.3) + (-A2.4) = (-(4)) + (-(2)) + (-(5)) + (-(4)) = -15
(A1.1) + (A1.2) = (4) + (2) = 6
(-A1.1) + (A1.2) = (-(4)) + (2) = -2
(A1.1) + (-A1.2) = (4) + (-(2)) = 2
(-A1.1) + (-A1.2) = (-(4)) + (-(2)) = -6
(A1.1) + (A1.2) + (A2.4) + (A2.3) = (4) + (2) + (4) + (2) = 12
(-A1.1) + (A1.2) + (A2.4) + (A2.3) = (-(4)) + (2) + (4) + (2) = 4
(A1.1) + (-A1.2) + (A2.4) + (A2.3) = (4) + (-(2)) + (4) + (2) = 8
(-A1.1) + (-A1.2) + (A2.4) + (A2.3) = (-(4)) + (-(2)) + (4) + (2) = 0
(A1.1) + (A1.2) + (-A2.4) + (A2.3) = (4) + (2) + (-(4)) + (2) = 4
(-A1.1) + (A1.2) + (-A2.4) + (A2.3) = (-(4)) + (2) + (-(4)) + (2) = -4
(A1.1) + (-A1.2) + (-A2.4) + (A2.3) = (4) + (-(2)) + (-(4)) + (2) = 0
(-A1.1) + (-A1.2) + (-A2.4) + (A2.3) = (-(4)) + (-(2)) + (-(4)) + (2) = -8
(A1.1) + (A1.2) + (A2.4) + (-A2.3) = (4) + (2) + (4) + (-(2)) = 8
(-A1.1) + (A1.2) + (A2.4) + (-A2.3) = (-(4)) + (2) + (4) + (-(2)) = 0
(A1.1) + (-A1.2) + (A2.4) + (-A2.3) = (4) + (-(2)) + (4) + (-(2)) = 4
(-A1.1) + (-A1.2) + (A2.4) + (-A2.3) = (-(4)) + (-(2)) + (4) + (-(2)) = -4
(A1.1) + (A1.2) + (-A2.4) + (-A2.3) = (4) + (2) + (-(4)) + (-(2)) = 0
(-A1.1) + (A1.2) + (-A2.4) + (-A2.3) = (-(4)) + (2) + (-(4)) + (-(2)) = -8
(A1.1) + (-A1.2) + (-A2.4) + (-A2.3) = (4) + (-(2)) + (-(4)) + (-(2)) = -4
(-A1.1) + (-A1.2) + (-A2.4) + (-A2.3) = (-(4)) + (-(2)) + (-(4)) + (-(2)) = -12
(A1.1) + (A1.2) + (A2.3) = (4) + (2) + (2) = 8
(-A1.1) + (A1.2) + (A2.3) = (-(4)) + (2) + (2) = 0
(A1.1) + (-A1.2) + (A2.3) = (4) + (-(2)) + (2) = 4
(-A1.1) + (-A1.2) + (A2.3) = (-(4)) + (-(2)) + (2) = -4
(A1.1) + (A1.2) + (-A2.3) = (4) + (2) + (-(2)) = 4
(-A1.1) + (A1.2) + (-A2.3) = (-(4)) + (2) + (-(2)) = -4
(A1.1) + (-A1.2) + (-A2.3) = (4) + (-(2)) + (-(2)) = 0
(-A1.1) + (-A1.2) + (-A2.3) = (-(4)) + (-(2)) + (-(2)) = -8
(A1.1) = (4) = 4
(-A1.1) = (-(4)) = -4
(A1.1) + (A2.4) + (A2.3) + (A2.2) = (4) + (4) + (2) + (5) = 15
(-A1.1) + (A2.4) + (A2.3) + (A2.2) = (-(4)) + (4) + (2) + (5) = 7
(A1.1) + (-A2.4) + (A2.3) + (A2.2) = (4) + (-(4)) + (2) + (5) = 7
(-A1.1) + (-A2.4) + (A2.3) + (A2.2) = (-(4)) + (-(4)) + (2) + (5) = -1
(A1.1) + (A2.4) + (-A2.3) + (A2.2) = (4) + (4) + (-(2)) + (5) = 11
(-A1.1) + (A2.4) + (-A2.3) + (A2.2) = (-(4)) + (4) + (-(2)) + (5) = 3
(A1.1) + (-A2.4) + (-A2.3) + (A2.2) = (4) + (-(4)) + (-(2)) + (5) = 3
(-A1.1) + (-A2.4) + (-A2.3) + (A2.2) = (-(4)) + (-(4)) + (-(2)) + (5) = -5
(A1.1) + (A2.4) + (A2.3) + (-A2.2) = (4) + (4) + (2) + (-(5)) = 5
(-A1.1) + (A2.4) + (A2.3) + (-A2.2) = (-(4)) + (4) + (2) + (-(5)) = -3
(A1.1) + (-A2.4) + (A2.3) + (-A2.2) = (4) + (-(4)) + (2) + (-(5)) = -3
(-A1.1) + (-A2.4) + (A2.3) + (-A2.2) = (-(4)) + (-(4)) + (2) + (-(5)) = -11
(A1.1) + (A2.4) + (-A2.3) + (-A2.2) = (4) + (4) + (-(2)) + (-(5)) = 1
(-A1.1) + (A2.4) + (-A2.3) + (-A2.2) = (-(4)) + (4) + (-(2)) + (-(5)) = -7
(A1.1) + (-A2.4) + (-A2.3) + (-A2.2) = (4) + (-(4)) + (-(2)) + (-(5)) = -7
(-A1.1) + (-A2.4) + (-A2.3) + (-A2.2) = (-(4)) + (-(4)) + (-(2)) + (-(5)) = -15
(A1.1) + (A2.3) + (A2.2) = (4) + (2) + (5) = 11
(-A1.1) + (A2.3) + (A2.2) = (-(4)) + (2) + (5) = 3
(A1.1) + (-A2.3) + (A2.2) = (4) + (-(2)) + (5) = 7
(-A1.1) + (-A2.3) + (A2.2) = (-(4)) + (-(2)) + (5) = -1
(A1.1) + (A2.3) + (-A2.2) = (4) + (2) + (-(5)) = 1
(-A1.1) + (A2.3) + (-A2.2) = (-(4)) + (2) + (-(5)) = -7
(A1.1) + (-A2.3) + (-A2.2) = (4) + (-(2)) + (-(5)) = -3
(-A1.1) + (-A2.3) + (-A2.2) = (-(4)) + (-(2)) + (-(5)) = -11
(A1.1) + (A2.2) = (4) + (5) = 9
(-A1.1) + (A2.2) = (-(4)) + (5) = 1
(A1.1) + (-A2.2) = (4) + (-(5)) = -1
(-A1.1) + (-A2.2) = (-(4)) + (-(5)) = -9
(A2.1) + (A2.2) + (A2.3) = (6) + (5) + (2) = 13
(-A2.1) + (A2.2) + (A2.3) = (-(6)) + (5) + (2) = 1
(A2.1) + (-A2.2) + (A2.3) = (6) + (-(5)) + (2) = 3
(-A2.1) + (-A2.2) + (A2.3) = (-(6)) + (-(5)) + (2) = -9
(A2.1) + (A2.2) + (-A2.3) = (6) + (5) + (-(2)) = 9
(-A2.1) + (A2.2) + (-A2.3) = (-(6)) + (5) + (-(2)) = -3
(A2.1) + (-A2.2) + (-A2.3) = (6) + (-(5)) + (-(2)) = -1
(-A2.1) + (-A2.2) + (-A2.3) = (-(6)) + (-(5)) + (-(2)) = -13
(A2.1) + (A2.2) + (A2.3) + (A1.4) = (6) + (5) + (2) + (6) = 19
(-A2.1) + (A2.2) + (A2.3) + (A1.4) = (-(6)) + (5) + (2) + (6) = 7
(A2.1) + (-A2.2) + (A2.3) + (A1.4) = (6) + (-(5)) + (2) + (6) = 9
(-A2.1) + (-A2.2) + (A2.3) + (A1.4) = (-(6)) + (-(5)) + (2) + (6) = -3
(A2.1) + (A2.2) + (-A2.3) + (A1.4) = (6) + (5) + (-(2)) + (6) = 15
(-A2.1) + (A2.2) + (-A2.3) + (A1.4) = (-(6)) + (5) + (-(2)) + (6) = 3
(A2.1) + (-A2.2) + (-A2.3) + (A1.4) = (6) + (-(5)) + (-(2)) + (6) = 5
(-A2.1) + (-A2.2) + (-A2.3) + (A1.4) = (-(6)) + (-(5)) + (-(2)) + (6) = -7
(A2.1) + (A2.2) + (A2.3) + (-A1.4) = (6) + (5) + (2) + (-(6)) = 7
(-A2.1) + (A2.2) + (A2.3) + (-A1.4) = (-(6)) + (5) + (2) + (-(6)) = -5
(A2.1) + (-A2.2) + (A2.3) + (-A1.4) = (6) + (-(5)) + (2) + (-(6)) = -3
(-A2.1) + (-A2.2) + (A2.3) + (-A1.4) = (-(6)) + (-(5)) + (2) + (-(6)) = -15
(A2.1) + (A2.2) + (-A2.3) + (-A1.4) = (6) + (5) + (-(2)) + (-(6)) = 3
(-A2.1) + (A2.2) + (-A2.3) + (-A1.4) = (-(6)) + (5) + (-(2)) + (-(6)) = -9
(A2.1) + (-A2.2) + (-A2.3) + (-A1.4) = (6) + (-(5)) + (-(2)) + (-(6)) = -7
(-A2.1) + (-A2.2) + (-A2.3) + (-A1.4) = (-(6)) + (-(5)) + (-(2)) + (-(6)) = -19
(A2.1) + (A2.2) = (6) + (5) = 11
(-A2.1) + (A2.2) = (-(6)) + (5) = -1
(A2.1) + (-A2.2) = (6) + (-(5)) = 1
(-A2.1) + (-A2.2) = (-(6)) + (-(5)) = -11
(A2.1) + (A2.2) + (A1.4) + (A1.3) = (6) + (5) + (6) + (5) = 22
(-A2.1) + (A2.2) + (A1.4) + (A1.3) = (-(6)) + (5) + (6) + (5) = 10
(A2.1) + (-A2.2) + (A1.4) + (A1.3) = (6) + (-(5)) + (6) + (5) = 12
(-A2.1) + (-A2.2) + (A1.4) + (A1.3) = (-(6)) + (-(5)) + (6) + (5) = 0
(A2.1) + (A2.2) + (-A1.4) + (A1.3) = (6) + (5) + (-(6)) + (5) = 10
(-A2.1) + (A2.2) + (-A1.4) + (A1.3) = (-(6)) + (5) + (-(6)) + (5) = -2
(A2.1) + (-A2.2) + (-A1.4) + (A1.3) = (6) + (-(5)) + (-(6)) + (5) = 0
(-A2.1) + (-A2.2) + (-A1.4) + (A1.3) = (-(6)) + (-(5)) + (-(6)) + (5) = -12
(A2.1) + (A2.2) + (A1.4) + (-A1.3) = (6) + (5) + (6) + (-(5)) = 12
(-A2.1) + (A2.2) + (A1.4) + (-A1.3) = (-(6)) + (5) + (6) + (-(5)) = 0
(A2.1) + (-A2.2) + (A1.4) + (-A1.3) = (6) + (-(5)) + (6) + (-(5)) = 2
(-A2.1) + (-A2.2) + (A1.4) + (-A1.3) = (-(6)) + (-(5)) + (6) + (-(5)) = -10
(A2.1) + (A2.2) + (-A1.4) + (-A1.3) = (6) + (5) + (-(6)) + (-(5)) = 0
(-A2.1) + (A2.2) + (-A1.4) + (-A1.3) = (-(6)) + (5) + (-(6)) + (-(5)) = -12
(A2.1) + (-A2.2) + (-A1.4) + (-A1.3) = (6) + (-(5)) + (-(6)) + (-(5)) = -10
(-A2.1) + (-A2.2) + (-A1.4) + (-A1.3) = (-(6)) + (-(5)) + (-(6)) + (-(5)) = -22
(A2.1) + (A2.2) + (A1.3) = (6) + (5) + (5) = 16
(-A2.1) + (A2.2) + (A1.3) = (-(6)) + (5) + (5) = 4
(A2.1) + (-A2.2) + (A1.3) = (6) + (-(5)) + (5) = 6
(-A2.1) + (-A2.2) + (A1.3) = (-(6)) + (-(5)) + (5) = -6
(A2.1) + (A2.2) + (-A1.3) = (6) + (5) + (-(5)) = 6
(-A2.1) + (A2.2) + (-A1.3) = (-(6)) + (5) + (-(5)) = -6
(A2.1) + (-A2.2) + (-A1.3) = (6) + (-(5)) + (-(5)) = -4
(-A2.1) + (-A2.2) + (-A1.3) = (-(6)) + (-(5)) + (-(5)) = -16
(A2.1) = (6) = 6
(-A2.1) = (-(6)) = -6
(A2.1) + (A1.4) + (A1.3) + (A1.2) = (6) + (6) + (5) + (2) = 19
(-A2.1) + (A1.4) + (A1.3) + (A1.2) = (-(6)) + (6) + (5) + (2) = 7
(A2.1) + (-A1.4) + (A1.3) + (A1.2) = (6) + (-(6)) + (5) + (2) = 7
(-A2.1) + (-A1.4) + (A1.3) + (A1.2) = (-(6)) + (-(6)) + (5) + (2) = -5
(A2.1) + (A1.4) + (-A1.3) + (A1.2) = (6) + (6) + (-(5)) + (2) = 9
(-A2.1) + (A1.4) + (-A1.3) + (A1.2) = (-(6)) + (6) + (-(5)) + (2) = -3
(A2.1) + (-A1.4) + (-A1.3) + (A1.2) = (6) + (-(6)) + (-(5)) + (2) = -3
(-A2.1) + (-A1.4) + (-A1.3) + (A1.2) = (-(6)) + (-(6)) + (-(5)) + (2) = -15
(A2.1) + (A1.4) + (A1.3) + (-A1.2) = (6) + (6) + (5) + (-(2)) = 15
(-A2.1) + (A1.4) + (A1.3) + (-A1.2) = (-(6)) + (6) + (5) + (-(2)) = 3
(A2.1) + (-A1.4) + (A1.3) + (-A1.2) = (6) + (-(6)) + (5) + (-(2)) = 3
(-A2.1) + (-A1.4) + (A1.3) + (-A1.2) = (-(6)) + (-(6)) + (5) + (-(2)) = -9
(A2.1) + (A1.4) + (-A1.3) + (-A1.2) = (6) + (6) + (-(5)) + (-(2)) = 5
(-A2.1) + (A1.4) + (-A1.3) + (-A1.2) = (-(6)) + (6) + (-(5)) + (-(2)) = -7
(A2.1) + (-A1.4) + (-A1.3) + (-A1.2) = (6) + (-(6)) + (-(5)) + (-(2)) = -7
(-A2.1) + (-A1.4) + (-A1.3) + (-A1.2) = (-(6)) + (-(6)) + (-(5)) + (-(2)) = -19
(A2.1) + (A1.3) + (A1.2) = (6) + (5) + (2) = 13
(-A2.1) + (A1.3) + (A1.2) = (-(6)) + (5) + (2) = 1
(A2.1) + (-A1.3) + (A1.2) = (6) + (-(5)) + (2) = 3
(-A2.1) + (-A1.3) + (A1.2) = (-(6)) + (-(5)) + (2) = -9
(A2.1) + (A1.3) + (-A1.2) = (6) + (5) + (-(2)) = 9
(-A2.1) + (A1.3) + (-A1.2) = (-(6)) + (5) + (-(2)) = -3
(A2.1) + (-A1.3) + (-A1.2) = (6) + (-(5)) + (-(2)) = -1
(-A2.1) + (-A1.3) + (-A1.2) = (-(6)) + (-(5)) + (-(2)) = -13
(A2.1) + (A1.2) = (6) + (2) = 8
(-A2.1) + (A1.2) = (-(6)) + (2) = -4
(A2.1) + (-A1.2) = (6) + (-(2)) = 4
(-A2.1) + (-A1.2) = (-(6)) + (-(2)) = -8