The symbols "!" and "?" stands for addition and subtraction, (not necessarily in that order) but for subtraction it can be the left argument subtract for the right or vice versa. e.g. a!b can be a-b, a+b or b-a. Variables and brackets can be used as usual. How to write $20a-18b$ for sure, with 'a' and 'b'?
My attempt: in the contest I found an expression that equals to 2(a-b), but I can't remember what it was. It's like ((a!b)?a)!((b?a)!b) or something like that. But I don't know how to add two different things in general.
Is it possible to form an expression that represent a+b?
Edit: $(a!a?a)?[(a!a)?(a!a)]=a$
Let me write the interpretations of any string using ? and ! as a 4-tuple. The first entry is the interpretation where ? is addition and ! is subtraction, the second is where ? is addition and ! is reversed subtraction, the third is where ? is subtraction and ! is addition, and the fourth is where ? is reversed subtraction and ! is addition. So for instance, I will write $$a?b=(a+b,a+b,a-b,b-a)$$ and $$a!b=(a-b,b-a,a+b,a+b).$$
The key trick is that we can negate one entry of a tuple at a time. Indeed, notice first that $$(a!a)?(a!a)=(0,0,0,0)$$ (and so I will subsequently abbreviate this string as just $0$). Therefore $$0!a=(-a,a,a,a),$$ $$a!0=(a,-a,a,a),$$ $$0?a=(a,a,-a,a),$$ and $$a?0=(a,a,a,-a).$$ Let me write the above four expressions as $F_1(a)$, $F_2(a)$, $F_3(a)$, and $F_4(a)$ (so $F_i$ just negates the $i$th coordinate).
It is now easy to make addition and negation. The addition $a+b$ can be made as $$F_4(a)?F_3(b)=(a+b,a+b,a-(-b),b-(-a))=(a+b,a+b,a+b,a+b).$$ We can also make $-a$ as $F_1(F_2(F_3(F_4(a))))$. By composing addition and negation, we can now easily represent $ma+nb$ for any integers $m$ and $n$.