Sponsored
Use these hints if you're stuck. Try solving on your own first.
The constraints are small enough to make brute-force solutions pass.
Solve with full IDE support and test cases