除了遍历一堆嵌套循环外,我该如何回答这种类型的组合问题呢?
there are two numbers E1 and E2
E1 = A * x + B* y + C* z, and E2 = A * p + B * q + C * r
Value of A, B, C are different positive integers.
Value of x, y, z, p, q, r may be the same, and they are positive integers.
我们可以为A, B, C, x, y, z, p, q, r
设置任何值,以便满足以下所有条件吗?
答案 0 :(得分:0)
是的,例如:
A=1, B=2, C=3
x=1, y=3, z=1
p=2, q=1, r=2
A*x+B*y+C*z = 1+6+3 = 10
A*p+B*q+C*r = 2+2+6 = 10
x+y+z = 5 = p+q+r