## Task B-1.6.

All letters in the equality $(a+b)(c+d)(e+f)(g+h)=5005$ should be replaced with different numbers from 1 to 8 so that the equality is correct. In how many ways can this be done?
## Solution.

The prime factorization of the number 5005 is $5005=5 \cdot 7 \cdot 11 \cdot 13$.

Therefore, each parenthesis in the given equation can be equal to one of the prime factors 5, 7, 11, 13. These can be written as the sum of two numbers from 1 to 8 in the following two ways:

1. If $5=1+4$, then it must be $7=2+5, 11=3+8, 13=6+7$. 2 points
2. If $5=2+3$, the only possibility is $7=1+6, 11=4+7, 13=5+8$.

In each parenthesis, the numbers can be swapped, so there are $2^{4}=16$ such arrangements.

The total number of arrangements is $2 \cdot 24 \cdot 16=768$.

Note: If the student did not consider the arrangement of the parentheses and the addends within the parentheses, they can receive a maximum of 5 points.

If the student only did not consider the swapping of the addends, and thus obtained a total solution of 48, assign 8 points.

If the student only did not consider the arrangement of the parentheses, and thus obtained a total solution of 32, assign 8 points.