## 砝码分盐问题——从数学和计算机的角度分析(3)

Content

3.1 基本思想

3.2 数据结构描述

3.3 第一次分解过程

3.4 第二次称量过程

3.5 第三次称量过程

3.6 如何输出？

3.7 输出结果

3.8 讨论

3. 能否编程计算？

3.1 基本思想

3.2 数据结构描述

00001: / **

00002: * the proble of dividing salt using weight.

00003: * a heap of salt with 280g, divide it into two small heaps of salt with 100g and 180g

00004: * respectively, in 3 steps. the weights are 4g and 14g. there is a balance of course.

00005: *

00006: * this is a pure mathematical method.

00007: */

00008: #include

00009:

00010: #define Max_Num 5

00011:

00012: int total = 280 ;              //the total weight of the heap of salt

00013: int heap1 = 100 , heap2 = 180 ; //the target weight of the two samll heaps of salt

00014: int ws [] = { , 4 , 10 , 14 , 18 };  //all cases of the weights combination

00015:

00016: /* the first division result */

00017: int x [ Max_Num ] = { }, y [ Max_Num ] = { };

00018:

00019: /* the second division result */

00020: int x1 [ Max_Num ][ Max_Num ] = { }, x2 [ Max_Num ][ Max_Num ] = { };

00021: int y1 [ Max_Num ][ Max_Num ] = { }, y2 [ Max_Num ][ Max_Num ] = { };

00022:

00023: /* the third division result */

00024: int x11 [ Max_Num ][ Max_Num ][ Max_Num ] = { }, x12 [ Max_Num ][ Max_Num ][ Max_Num ] = { };

00025: int x21 [ Max_Num ][ Max_Num ][ Max_Num ] = { }, x22 [ Max_Num ][ Max_Num ][ Max_Num ] = { };

00026: int y11 [ Max_Num ][ Max_Num ][ Max_Num ] = { }, y12 [ Max_Num ][ Max_Num ][ Max_Num ] = { };

00027: int y21 [ Max_Num ][ Max_Num ][ Max_Num ] = { }, y22 [ Max_Num ][ Max_Num ][ Max_Num ] = { };

1 ：编译该代码时会出现如下警告，是因为在 Linux 平台，有内建的函数名为 y1 ，命名冲突，故出现该警告，可通过 "man y1" 命令查看该函数的说明。如果想消除该警告，请将代码中 y1 数组重新命名。

weight3.c:21: warning: built-in function ‘y1’ declared as non-function

2 gcc 编译器对上述的 x1/x2/x11/x12/x21/x22/y11/y12/y21/y22 数组初始化会出现如下警告。

# make

gcc -g -Wall -Wextra -c weight1.c

weight1.c:20: warning: missing braces around initializer

weight1.c:20: warning: (near initialization for ‘x1[0]’)

weight1.c:20: warning: missing braces around initializer

weight1.c:20: warning: (near initialization for ‘x2[0]’)

weight1.c:21: warning: built-in function ‘y1’ declared as non-function

weight1.c:21: warning: missing braces around initializer

weight1.c:21: warning: (near initialization for ‘y1[0]’)

weight1.c:21: warning: missing braces around initializer

weight1.c:21: warning: (near initialization for ‘y2[0]’)

weight1.c:24: warning: missing braces around initializer

weight1.c:24: warning: (near initialization for ‘x11[0]’)

weight1.c:24: warning: missing braces around initializer

weight1.c:24: warning: (near initialization for ‘x12[0]’)

weight1.c:25: warning: missing braces around initializer

weight1.c:25: warning: (near initialization for ‘x21[0]’)

weight1.c:25: warning: missing braces around initializer

weight1.c:25: warning: (near initialization for ‘x22[0]’)

weight1.c:26: warning: missing braces around initializer

weight1.c:26: warning: (near initialization for ‘y11[0]’)

weight1.c:26: warning: missing braces around initializer

weight1.c:26: warning: (near initialization for ‘y12[0]’)

weight1.c:27: warning: missing braces around initializer

weight1.c:27: warning: (near initialization for ‘y21[0]’)

weight1.c:27: warning: missing braces around initializer

weight1.c:27: warning: (near initialization for ‘y22[0]’)

...

00016: /* the first division result */

00017: int x [ Max_Num ] = { }, y [ Max_Num ] = { };

00018:

00019: /* the second division result */

00020: int x1 [ Max_Num ][ Max_Num ] = {{ }}, x2 [ Max_Num ][ Max_Num ] = {{ }};

00021: int y1 [ Max_Num ][ Max_Num ] = {{ }}, y2 [ Max_Num ][ Max_Num ] = {{ }};

00022:

00023: /* the third division result */

00024: int x11 [ Max_Num ][ Max_Num ][ Max_Num ] = {{{ }}}, x12 [ Max_Num ][ Max_Num ][ Max_Num ] = {{{ }}};

00025: int x21 [ Max_Num ][ Max_Num ][ Max_Num ] = {{{ }}}, x22 [ Max_Num ][ Max_Num ][ Max_Num ] = {{{ }}};

00026: int y11 [ Max_Num ][ Max_Num ][ Max_Num ] = {{{ }}}, y12 [ Max_Num ][ Max_Num ][ Max_Num ] = {{{ }}};

00027: int y21 [ Max_Num ][ Max_Num ][ Max_Num ] = {{{ }}}, y22 [ Max_Num ][ Max_Num ][ Max_Num ] = {{{ }}};

3.3 第一次分解过程

00030: /** the first division, according to z=x+y, x <= y */

00031: void weight1 ()

00032: {

00033:    int z = total ;

00034:    int i = , j = , k = , w = ;

00035:

00036:    for ( k = ; k < Max_Num ; k ++ )

00037:    {

00038:       w = ws [ k ];

00039:       x [ k ] = ( z - w ) / 2 ;

00040:       y [ k ] = ( z + w ) / 2 ;

00041:       if ( x [ k ] % 2 != ) //no need to judge y[k]

00042:          x [ k ] = y [ k ] = ;

00043:    }

00044: }

3.4 第二次称量过程

00046: /** the second division, according to x=x1+x2, y=y1+y2, x1<=x2, y1<=y2

00047:    for x[i], x[i] = x1[i][k] + x2[i][k]

00048:    for y[i], y[i] = y1[i][k] + y2[i][k]

00049:    do them in the same loop to reduce the occurrence time of for- loop

00050: */

00051: void weight2 ()

00052: {

00053:    int i = , j = , k = , w = ;

00054:

00055:    for ( i = ; i < Max_Num ; i ++ )

00056:    {

00057:       if ( x [ i ] == ) //no need to judge y[i]

00058:          continue ;

00059:

00060:       for ( k = ; k < Max_Num ; k ++ )

00061:       {

00062:          w = ws [ k ];

00063:

00064:          x1 [ i ][ k ] = ( x [ i ] - w ) / 2 ;

00065:          x2 [ i ][ k ] = ( x [ i ] + w ) / 2 ;

00066:          if ( x1 [ i ][ k ] % 2 != ) //no need to judge x2[i][k]

00067:             x1 [ i ][ k ] = x2 [ i ][ k ] = ;

00068:

00069:          if ( x [ i ] == y [ i ]) //to avoid repeatance

00070:             continue ;

00071:

00072:          y1 [ i ][ k ] = ( y [ i ] - w ) / 2 ;

00073:          y2 [ i ][ k ] = ( y [ i ] + w ) / 2 ;

00074:          if ( y1 [ i ][ k ] % 2 != ) //no need to judge y2[i][k]

00075:             y1 [ i ][ k ] = y2 [ i ][ k ] = ;

00076:       }

00077:    }

00078: }

3.5 第三次称量过程

00079:

00080: /** the third division, according to

00081:    x1=x11+x12, y1=y11+y12, x11<=x12, y11<=y12

00082:    x2=x21+x22, y2=y21+y22, x21<=x22, y21<=y22

00083:    for x1[i][j], x1[i][j] = x11[i][j][k] + x12[i][j][k]

00084:    for x2[i][j], x2[i][j] = x21[i][j][k] + x22[i][j][k]

00085:    for y1[i][j], y1[i][j] = y11[i][j][k] + y12[i][j][k]

00086:    for y2[i][j], y2[i][j] = y21[i][j][k] + y22[i][j][k]

00087:    do them in the same loop to reduce the occurrence time of for- loop

00088: */

00089: void weight3 ()

00090: {

00091:    int i = , j = , k = , w = ;

00092:

00093:    for ( i = ; i < Max_Num ; i ++ )

00094:    {

00095:       if ( x [ i ] == ) //no need to judge y[i]

00096:          continue ;

00097:

00098:       for ( j = ; j < Max_Num ; j ++ )

00099:       {

00100:          for ( k = ; k < Max_Num ; k ++ )

00101:          {

00102:             w = ws [ k ];

00103:

00104:             if ( x1 [ i ][ j ] != ) //divide x1[i][j]

00105:             {

00106:                x11 [ i ][ j ][ k ] = ( x1 [ i ][ j ] - w ) / 2 ;

00107:                x12 [ i ][ j ][ k ] = ( x1 [ i ][ j ] + w ) / 2 ;

00108:                if ( x11 [ i ][ j ][ k ] % 2 != ) //x11[i][j][k] and x12[i][j][k] must be even

00109:                   x11 [ i ][ j ][ k ] = x12 [ i ][ j ][ k ] = ;

00110:             }

00111:

00112:             if ( x2 [ i ][ j ] != 0 && x1 [ i ][ j ] != x2 [ i ][ j ]) //divide x2[i][j], and to avoid repeatance

00113:             {

00114:                x21 [ i ][ j ][ k ] = ( x2 [ i ][ j ] - w ) / 2 ;

00115:                x22 [ i ][ j ][ k ] = ( x2 [ i ][ j ] + w ) / 2 ;

00116:                if ( x21 [ i ][ j ][ k ] % 2 != ) //x21[i][j][k] and x22[i][j][k] must be even

00117:                   x21 [ i ][ j ][ k ] = x22 [ i ][ j ][ k ] = ;

00118:             }

00119:

00120:             if ( y1 [ i ][ j ] != ) //divide y1[i][j]

00121:             {

00122:                y11 [ i ][ j ][ k ] = ( y1 [ i ][ j ] - w ) / 2 ;

00123:                y12 [ i ][ j ][ k ] = ( y1 [ i ][ j ] + w ) / 2 ;

00124:                if ( y11 [ i ][ j ][ k ] % 2 != ) //y11[i][j][k] and y12[i][j][k] must be even

00125:                   y11 [ i ][ j ][ k ] = y12 [ i ][ j ][ k ] = ;

00126:             }

00127:

00128:             if ( y2 [ i ][ j ] != 0 && y1 [ i ][ j ] != y2 [ i ][ j ]) //divide y2[i][j], and to avoid repeatance

00129:             {

00130:                y21 [ i ][ j ][ k ] = ( y2 [ i ][ j ] - w ) / 2 ;

00131:                y22 [ i ][ j ][ k ] = ( y2 [ i ][ j ] + w ) / 2 ;

00132:                if ( y21 [ i ][ j ][ k ] % 2 != ) //y21[i][j][k] and y22[i][j][k] must be even

00133:                   y21 [ i ][ j ][ k ] = y22 [ i ][ j ][ k ] = ;

00134:             }

00135:          }

00136:       }

00137:    }

00138: }

3.6 如何输出？

3.7 输出结果

-------------------------------------

the results of all correct divisions:

-------------------------------------

280 = 140 + 140

140 = 70 + 70

70 = 30 + 40

280 = 138 + 142

138 = 62 + 76

62 = 24 + 38

280 = 138 + 142

138 = 62 + 76

76 = 38 + 38

280 = 138 + 142

142 = 66 + 76

66 = 24 + 42

280 = 138 + 142

142 = 62 + 80

80 = 38 + 42

3.8 讨论

```/**
* the proble of dividing salt using weight.
* a heap of salt with 280g, divide it into two small heaps of salt with 100g and 180g
* respectively, in 3 steps. the weights are 4g and 14g. there is a balance of course.
*
* this is a pure mathematical method.
*/
#include <stdio.h>
#define Max_Num 5
int total = 280;  //the total weight of the heap of salt
int heap1 = 100, heap2 = 180;  //the target weight of the two samll heaps of salt
int ws[]={0, 4, 10, 14, 18};  //all cases of the weights combination
/* the first division result */
int x[Max_Num] = {0}, y[Max_Num] = {0};
/* the second division result */
int x1[Max_Num][Max_Num] = {{0}}, x2[Max_Num][Max_Num] = {{0}};
int y1[Max_Num][Max_Num] = {{0}}, y2[Max_Num][Max_Num] = {{0}};
/* the third division result */
int x11[Max_Num][Max_Num][Max_Num] = {{{0}}}, x12[Max_Num][Max_Num][Max_Num] = {{{0}}};
int x21[Max_Num][Max_Num][Max_Num] = {{{0}}}, x22[Max_Num][Max_Num][Max_Num] = {{{0}}};
int y11[Max_Num][Max_Num][Max_Num] = {{{0}}}, y12[Max_Num][Max_Num][Max_Num] = {{{0}}};
int y21[Max_Num][Max_Num][Max_Num] = {{{0}}}, y22[Max_Num][Max_Num][Max_Num] = {{{0}}};
/** the first division, according to z=x+y, x <= y */
void weight1()
{
int z = total;
int k = 0, w = 0;
for (k = 0; k < Max_Num; k++)
{
w = ws[k];
x[k] = (z - w)/2;  //divide z
y[k] = (z + w)/2;
if (x[k] % 2 != 0)  //no need to judge y[k]
x[k] = y[k] = 0;
}
}
/** the second division, according to x=x1+x2, y=y1+y2, x1<=x2, y1<=y2
for x[i], x[i] = x1[i][k] + x2[i][k]
for y[i], y[i] = y1[i][k] + y2[i][k]
do them in the same loop to reduce the occurrence time of for-loop
*/
void weight2()
{
int i = 0, k = 0, w = 0;
for (i = 0; i < Max_Num; i++)
{
if (x[i] == 0)  //no need to judge y[i]
continue;
for (k = 0; k < Max_Num; k++)
{
w = ws[k];
x1[i][k] = (x[i] - w)/2;  //divide x
x2[i][k] = (x[i] + w)/2;
if (x1[i][k] % 2 != 0)  //no need to judge x2[i][k]
x1[i][k] = x2[i][k] = 0;
if (x[i] == y[i])  //to avoid repeatance
continue;
y1[i][k] = (y[i] - w)/2;  //divide y
y2[i][k] = (y[i] + w)/2;
if (y1[i][k] % 2 != 0)  //no need to judge y2[i][k]
y1[i][k] = y2[i][k] = 0;
}
}
}
/** the third division, according to
x1=x11+x12, y1=y11+y12, x11<=x12, y11<=y12
x2=x21+x22, y2=y21+y22, x21<=x22, y21<=y22
for x1[i][j], x1[i][j] = x11[i][j][k] + x12[i][j][k]
for x2[i][j], x2[i][j] = x21[i][j][k] + x22[i][j][k]
for y1[i][j], y1[i][j] = y11[i][j][k] + y12[i][j][k]
for y2[i][j], y2[i][j] = y21[i][j][k] + y22[i][j][k]
do them in the same loop to reduce the occurrence time of for-loop
*/
void weight3()
{
int i = 0, j = 0, k = 0, w = 0;
for (i = 0; i < Max_Num; i++)
{
if (x[i] == 0)  //no need to judge y[i]
continue;
for (j = 0; j < Max_Num; j++)
{
for (k = 0; k < Max_Num; k++)
{
w = ws[k];
if (x1[i][j] != 0)  //divide x1[i][j]
{
x11[i][j][k] = (x1[i][j] - w)/2;
x12[i][j][k] = (x1[i][j] + w)/2;
if (x11[i][j][k]%2 != 0)  //x11[i][j][k] and x12[i][j][k] must be even
x11[i][j][k] = x12[i][j][k] = 0;
}
if (x2[i][j] != 0 && x1[i][j] != x2[i][j])  //divide x2[i][j], and to avoid repeatance
{
x21[i][j][k] = (x2[i][j] - w)/2;
x22[i][j][k] = (x2[i][j] + w)/2;
if (x21[i][j][k]%2 != 0)  //x21[i][j][k] and x22[i][j][k] must be even
x21[i][j][k] = x22[i][j][k] = 0;
}
if (y1[i][j] != 0)  //divide y1[i][j]
{
y11[i][j][k] = (y1[i][j] - w)/2;
y12[i][j][k] = (y1[i][j] + w)/2;
if (y11[i][j][k]%2 != 0)  //y11[i][j][k] and y12[i][j][k] must be even
y11[i][j][k] = y12[i][j][k] = 0;
}
if (y2[i][j] != 0 && y1[i][j] != y2[i][j])  //divide y2[i][j], and to avoid repeatance
{
y21[i][j][k] = (y2[i][j] - w)/2;
y22[i][j][k] = (y2[i][j] + w)/2;
if (y21[i][j][k]%2 != 0)  //y21[i][j][k] and y22[i][j][k] must be even
y21[i][j][k] = y22[i][j][k] = 0;
}
}
}
}
}
void dump_all_results()
{
int i = 0, j = 0, k = 0;
for (i = 0; i < Max_Num; i++)
{
if (x[i] == 0)  //no need to judge y[i]
continue;
for (j = 0; j < Max_Num; j++)
{
if (x1[i][j] == 0)  //no need to judge x2[i][j]
continue;
for (k = 0; k < Max_Num; k++)
{
if (x11[i][j][k] != 0)  //no need to judge x12[i][j][k]
{
printf("%d = %d + %d/n", total, x[i], y[i]);
printf("%d = %d + %d/n", x[i], x1[i][j], x2[i][j]);
printf("%d = %d + %d/n/n", x1[i][j], x11[i][j][k], x12[i][j][k]);
}
}
for (k = 0; k < Max_Num; k++)
{
if (x21[i][j][k] != 0)  //no need to judge x22[i][j][k]
{
printf("%d = %d + %d/n", total, x[i], y[i]);
printf("%d = %d + %d/n", x[i], x1[i][j], x2[i][j]);
printf("%d = %d + %d/n/n", x2[i][j], x21[i][j][k], x22[i][j][k]);
}
}
}
for (j = 0; j < Max_Num; j++)
{
if (y1[i][j] == 0)  //no need to judge y2[i][j]
continue;
for (k = 0; k < Max_Num; k++)
{
if (y11[i][j][k] != 0)  //no need to judge y12[i][j][k]
{
printf("%d = %d + %d/n", total, x[i], y[i]);
printf("%d = %d + %d/n", y[i], y1[i][j], y2[i][j]);
printf("%d = %d + %d/n/n", y1[i][j], y11[i][j][k], y12[i][j][k]);
}
}
for (k = 0; k < Max_Num; k++)
{
if (y21[i][j][k] != 0)  //no need to judge y22[i][j][k]
{
printf("%d = %d + %d/n", total, x[i], y[i]);
printf("%d = %d + %d/n", y[i], y1[i][j], y2[i][j]);
printf("%d = %d + %d/n/n", y2[i][j], y21[i][j][k], y22[i][j][k]);
}
}
}
}
}
void dump_correct_results()
{
int i = 0, j = 0, k = 0;
for (i = 0; i < Max_Num; i++)
{
if (x[i] == 0)  //no need to judge y[i]
continue;
for (j = 0; j < Max_Num; j++)
{
if (x1[i][j] == 0)  //no need to judge x2[i][j]
continue;
for (k = 0; k < Max_Num; k++)
{
if (x11[i][j][k] != 0 && (x11[i][j][k] + x2[i][j] == heap1 || x12[i][j][k] + x2[i][j] == heap1))  //divide x1[i][j]
{
printf("%d = %d + %d/n", total, x[i], y[i]);
printf("%d = %d + %d/n", x[i], x1[i][j], x2[i][j]);
printf("%d = %d + %d/n/n", x1[i][j], x11[i][j][k], x12[i][j][k]);
}
}
for (k = 0; k < Max_Num; k++)
{
if (x21[i][j][k] != 0 && (x21[i][j][k] + x1[i][j] == heap1 || x22[i][j][k] + x1[i][j] == heap1))  //divide x2[i][j]
{
printf("%d = %d + %d/n", total, x[i], y[i]);
printf("%d = %d + %d/n", x[i], x1[i][j], x2[i][j]);
printf("%d = %d + %d/n/n", x2[i][j], x21[i][j][k], x22[i][j][k]);
}
}
}
for (j = 0; j < Max_Num; j++)
{
if (y1[i][j] == 0)  //no need to judge y2[i][j]
continue;
for (k = 0; k < Max_Num; k++)
{
if (y11[i][j][k] != 0 && (y11[i][j][k] + y2[i][j] == heap1 || y12[i][j][k] + y2[i][j] == heap1))  //divide y1[i][j]
{
printf("%d = %d + %d/n", total, x[i], y[i]);
printf("%d = %d + %d/n", y[i], y1[i][j], y2[i][j]);
printf("%d = %d + %d/n/n", y1[i][j], y11[i][j][k], y12[i][j][k]);
}
}
for (k = 0; k < Max_Num; k++)
{
if (y21[i][j][k] != 0 && (y21[i][j][k] + y1[i][j] == heap1 || y22[i][j][k] + y1[i][j] == heap1))  //divide y2[i][j]
{
printf("%d = %d + %d/n", total, x[i], y[i]);
printf("%d = %d + %d/n", y[i], y1[i][j], y2[i][j]);
printf("%d = %d + %d/n/n", y2[i][j], y21[i][j][k], y22[i][j][k]);
}
}
}
}
}
int main(/* int argc, char** argv */)
{
weight1();
weight2();
weight3();
printf("-----------------------------/n");
printf("the results of all divisions:/n");
printf("-----------------------------/n");
dump_all_results();
printf("-------------------------------------/n");
printf("the results of all correct divisions:/n");
printf("-------------------------------------/n");
dump_correct_results();
return 0;
}```

-----------------------------
the results of all divisions:
-----------------------------
280 = 140 + 140
140 = 70 + 70
70 = 30 + 40

280 = 140 + 140
140 = 70 + 70
70 = 28 + 42

280 = 140 + 140
140 = 70 + 70
70 = 26 + 44

280 = 140 + 140
140 = 68 + 72
68 = 34 + 34

280 = 140 + 140
140 = 68 + 72
68 = 32 + 36

280 = 140 + 140
140 = 68 + 72
72 = 36 + 36

280 = 140 + 140
140 = 68 + 72
72 = 34 + 38

280 = 138 + 142
138 = 64 + 74
64 = 32 + 32

280 = 138 + 142
138 = 64 + 74
64 = 30 + 34

280 = 138 + 142
138 = 64 + 74
74 = 32 + 42

280 = 138 + 142
138 = 64 + 74
74 = 30 + 44

280 = 138 + 142
138 = 64 + 74
74 = 28 + 46

280 = 138 + 142
138 = 62 + 76
62 = 26 + 36

280 = 138 + 142
138 = 62 + 76
62 = 24 + 38

280 = 138 + 142
138 = 62 + 76
62 = 22 + 40

280 = 138 + 142
138 = 62 + 76
76 = 38 + 38

280 = 138 + 142
138 = 62 + 76
76 = 36 + 40

280 = 138 + 142
138 = 60 + 78
60 = 30 + 30

280 = 138 + 142
138 = 60 + 78
60 = 28 + 32

280 = 138 + 142
138 = 60 + 78
78 = 34 + 44

280 = 138 + 142
138 = 60 + 78
78 = 32 + 46

280 = 138 + 142
138 = 60 + 78
78 = 30 + 48

280 = 138 + 142
142 = 66 + 76
66 = 28 + 38

280 = 138 + 142
142 = 66 + 76
66 = 26 + 40

280 = 138 + 142
142 = 66 + 76
66 = 24 + 42

280 = 138 + 142
142 = 66 + 76
76 = 38 + 38

280 = 138 + 142
142 = 66 + 76
76 = 36 + 40

280 = 138 + 142
142 = 64 + 78
64 = 32 + 32

280 = 138 + 142
142 = 64 + 78
64 = 30 + 34

280 = 138 + 142
142 = 64 + 78
78 = 34 + 44

280 = 138 + 142
142 = 64 + 78
78 = 32 + 46

280 = 138 + 142
142 = 64 + 78
78 = 30 + 48

280 = 138 + 142
142 = 62 + 80
62 = 26 + 36

280 = 138 + 142
142 = 62 + 80
62 = 24 + 38

280 = 138 + 142
142 = 62 + 80
62 = 22 + 40

280 = 138 + 142
142 = 62 + 80
80 = 40 + 40

280 = 138 + 142
142 = 62 + 80
80 = 38 + 42

-------------------------------------
the results of all correct divisions:
-------------------------------------
280 = 140 + 140
140 = 70 + 70
70 = 30 + 40

280 = 138 + 142
138 = 62 + 76
62 = 24 + 38

280 = 138 + 142
138 = 62 + 76
76 = 38 + 38

280 = 138 + 142
142 = 66 + 76
66 = 24 + 42

280 = 138 + 142
142 = 62 + 80
80 = 38 + 42