Task B-1.2. Using the digits 1, 3, 4, 5, and a, where $a$ is also some digit (not necessarily distinct), write the largest possible five-digit number that is divisible by 12. Each of the digits $1,3,4,5, a$ must be used.
## Solution.

Let the desired number be $n$. If $n$ is divisible by 12, it is divisible by 3 and 4.

For $n$ to be divisible by 3, the sum of its digits must be divisible by 3.

Then $1+3+4+5+a=13+a$ is divisible by 3.

Since $a \in\{0,1, \ldots, 9\}$, we conclude that $a$ can be one of the numbers 2, 5, or 8.

Thus, the digits are 1, 3, 4, 5, 2 or 1, 3, 4, 5, 5 or 1, 3, 4, 5, 8.

The number $n$ is even, so it can end with 2, 4, or 8. For the number to be divisible by 4, its two-digit ending must be divisible by 4.

In the first case, the endings are $12, 24, 32, 52$, so the largest such number is 54312.

In the second case, none of them are divisible by 4.

In the third case, the endings are 48, 84, and the largest such number is 53184.

Therefore, the largest desired number is 54312.