Task 4.2. Find the smallest number in which all digits are different, and the sum of all digits is 32.
Answer: 26789.

Solution. For a four-digit number with different digits, the maximum possible sum of digits is $9+8+7+6=30<32$, so the number we need must be at least five digits.

We will try to make the first digit as small as possible. It is clear that it is no less than 2. We will place 2 in the first position. The sum of the remaining four digits is 30, which can only be obtained as $9+8+7+6$. We place the smallest of these digits, 6, in the second position, the next largest digit, 7, in the third position, 8 in the fourth, and 9 in the fifth.