A person forgets his 4-digit ATM pin code. But he remembers that in the code all the digits are different, the greatest digit is 7, and the sum of the first two digits is equal to the sum of the last two digits. Then the maximum number of trials necessary to obtain the correct code is \_\_\_\_\_\_\_
Answer: 72
Solutions · 1
Official solution
Choose 4 distinct digits from {0,…,7} with maximum =7, then split into two pairs with equal sums, and arrange within each pair and pair-order.
Working through the valid digit sets and their splits, the total number of valid codes (permutations satisfying all constraints) is:
\[\text{Total} = 72\]