# 8.1. Condition:

A five-digit number is called a hill if the first three digits are in ascending order and the last three digits are in descending order. For example, 13760 and 28932 are hills, while 78821 and 86521 are not hills. How many hills exist that are greater than the number $77777?$

#
# Answer: 36

## Solution.

Suitable slides must start with 7, so the next digit is either 8 or 9. If the second position is occupied by the digit 9, the third digit will not be greater than the second, so the condition is only satisfied by 8. Therefore, the third position is occupied by 9. The last two positions can be occupied by any two different digits from 0 to 8. There are $9 \cdot 8 / 2 = 36$ such pairs of digits, because we first choose a digit for the second-to-last position (from 0 to 8), and then from the remaining eight digits, we choose the one that will go at the end (from 0 to 8, excluding the digit in the second-to-last position). Since the order of the digits matters, we divide the resulting number of ways by two, as the digits are divided into pairs of the form (a, b), (b, a). For example, the combination of digits 2 and 7 can be 27 or 72 (in that order), and in each such pair, only one way is suitable - where the digits are in descending order.