简体   繁体   中英

Calculations between two integer arrays

I have a randomly generated integer array(A1), including following features in it.

  1. array length is 4
  2. elements were filled with integer values from 1 to 9
  3. no repeating values
  4. ordered in ascending-order

Now there is an another array(A2) which is the descending ordered array of the A1.
What I'm planning to do is, get ALL POSSIBLE linear and cross calculations(only adding) between these two arrays.
Starting array can be A1 or A2 but, should always starts with zeroth element.
A value in A1 or A2, can be taken in both positive or negative forms, to do the calculation.
Values should picked from array/s in increasing order of the array index.

EXAMPLE : 1 EX1

EXAMPLE : 2 EX2

EXAMPLE : 3
EX3

EXAMPLE : 4
EX4

At first, I've been trying to do this by using only for loops but then I applied recursion to it. But, It only works for calculations of one or two values. Is there any efficient way to do this? Hope my question is clear enough!

EDITED

Let's take A1=[1,2,3,4] So, the A2=[4,3,2,1]
Then the results of possible calculations should be like following

  1. 1 + nothing = 1
  2. -1 + nothing = -1
  3. 4 + nothing = 4
  4. -4 + nothing = -4
  5. 1 + 2 = 3
  6. 1 - 2 = -1
  7. 1 + 3 = 4
  8. 1 - 3 = -2
  9. -1 + 2 = 1
  10. -1 - 2 = -3
  11. -1 + 3 = 2
  12. -1 - 3 = -4
  13. 1 + 2 + 3 = 6
  14. ......
  15. ......

Finally, for a array length of 4, there should be 340 possible calculations.

1, -1, 4, -4, 3, -1, 4, -2, 1, -3,
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,

Something like this?

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);
    }
}

Output

[1, 2, 4, 7]
[7, 4, 2, 1]
[1, 3, 7, 14, 0, 8, 6, -1, 6, -8, 0, -2, 5, 12, -2, 6, 4, 1, 8, -6, 2, 0, -1, 3, 10, -4, 4, 2, -5, 2, -12, -4, -6, 1, 8, -6, 2, 0, -3, 4, -10, -2, -4, 5, 9, 16, 2, 10, 8, 1, 8, -6, 2, 0, 7, 14, 0, 8, 6, 3, 10, -4, 4, 2, -3, 1, 8, -6, 2, 0, -7, 0, -14, -6, -8, -1, 6, -8, 0, -2, -5, 2, -12, -4, -6, -1, 1, 5, 12, -2, 6, 4, -3, 4, -10, -2, -4, 3, 10, -4, 4, 2, -1, 6, -8, 0, -2, -3, 1, 8, -6, 2, 0, -7, 0, -14, -6, -8, -1, 6, -8, 0, -2, -5, 2, -12, -4, -6, 3, 7, 14, 0, 8, 6, -1, 6, -8, 0, -2, 5, 12, -2, 6, 4, 1, 8, -6, 2, 0, -5, -1, 6, -8, 0, -2, -9, -2, -16, -8, -10, -3, 4, -10, -2, -4, -7, 0, -14, -6, -8, 7, 9, 13, 20, 6, 14, 12, 5, 12, -2, 6, 4, 11, 18, 4, 12, 10, 7, 14, 0, 8, 6, 5, 9, 16, 2, 10, 8, 1, 8, -6, 2, 0, 7, 14, 0, 8, 6, 3, 10, -4, 4, 2, 11, 15, 22, 8, 16, 14, 7, 14, 0, 8, 6, 13, 20, 6, 14, 12, 9, 16, 2, 10, 8, 3, 7, 14, 0, 8, 6, -1, 6, -8, 0, -2, 5, 12, -2, 6, 4, 1, 8, -6, 2, 0, -7, -5, -1, 6, -8, 0, -2, -9, -2, -16, -8, -10, -3, 4, -10, -2, -4, -7, 0, -14, -6, -8, -9, -5, 2, -12, -4, -6, -13, -6, -20, -12, -14, -7, 0, -14, -6, -8, -11, -4, -18, -10, -12, -3, 1, 8, -6, 2, 0, -7, 0, -14, -6, -8, -1, 6, -8, 0, -2, -5, 2, -12, -4, -6, -11, -7, 0, -14, -6, -8, -15, -8, -22, -14, -16, -9, -2, -16, -8, -10, -13, -6, -20, -12, -14, 2, 6, 13, -1, 7, 5, -2, 5, -9, -1, -3, 4, 11, -3, 5, 3, 0, 7, -7, 1, -1, -2, 2, 9, -5, 3, 1, -6, 1, -13, -5, -7, 0, 7, -7, 1, -1, -4, 3, -11, -3, -5, 4, 8, 15, 1, 9, 7, 0, 7, -7, 1, -1, 6, 13, -1, 7, 5, 2, 9, -5, 3, 1, -4, 0, 7, -7, 1, -1, -8, -1, -15, -7, -9, -2, 5, -9, -1, -3, -6, 1, -13, -5, -7, 4, 11, -3, 5, 3, -4, 3, -11, -3, -5, 2, 9, -5, 3, 1, -2, 5, -9, -1, -3, 7, -7, 1, -1]

UPDATE

Since you indicated you'd like the formula's numbered and printed, here is a non-recursive implementation that uses bit-pattern to choose each 1-of-4 part to sum up.

Notice that both previous implementation and this new one returns 448 combinations, not the 340 you mentioned.

The code builds a list of all the combinations. You can then choose to sort the list (like this sort by combo length), and whether you want to collect the sums, or print the text formulas or the numeric formulas.

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;
    }
}

Output

  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

Here is what I could write for you:

Source:

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;
}

Output:

(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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM