Problem:
The numbers are from 1 to 10 . Place an equal sign (somewhere between them) and any arithmetic operator {+ - * /} , so that an ideal integer results in equality (both the final result and the partial results must be an integer)
Example:
1 * 2 * 3 * 4 * 5/6 + 7 = 8 + 9 + 101 * 2 * 3 * 4 * 5/6 + 7-8 = 9 + 10
1 * 2 * 3 * 4 * 5/6 + 7 = 8 + 9 + 10
1 * 2 * 3 * 4 * 5/6 + 7-8 = 9 + 10
My first idea to solve this problem was to use backtracking:
.
, : , , -, - ?
. . , , dict. .
226 Python 0,15 . , , , ? 20683 . : 10327 10356 .
, , . , allov , . , - , , . 2, 3, 5 7 - , . 4 . , 2*3*4*5/6, 4*5*6*7/8 3*4*5*6*7*8/9. , , , , - .
2*3*4*5/6
4*5*6*7/8
3*4*5*6*7*8/9