Sponsored
Use these hints if you're stuck. Try solving on your own first.
Simulate the tournament as given in the statement.
Be careful when handling odd integers.
Solve with full IDE support and test cases