it's a task, on which i think during whole day.
i have four integer numbers
a, b, c, d, and ineger x[1,40].
i must write a program, which can find the values of {a,b,c,d}, for which one of following equations is true for any (x<=40, x=1)
x=a or
x=b or
x=a+b or
x=a+b+c+d or
x+a=c+d or
x+a+b=c+d or
...
x+a+b+c=d or ...
it is very difficult to explain what i want to say. maybe the example will be helpful.
example:
if x=17, by {a=1,b=2,c=5,d=15} i can write x+a+b=c+d
whole question is to present any x[1,40] by {a,b,c,d}.
hope that you understand what i want to say, and thanks in advance