Editorial for ICPC NAQ 2016 K - Robotopia
Remember to use this editorial only when stuck, and not to copy-paste code from it. Please be respectful to the problem author and editorialist.
Submitting an official solution before solving the problem yourself is a bannable offence.
Submitting an official solution before solving the problem yourself is a bannable offence.
- We're looking for positive integers such that:
- This is a system of linear equations, but we want integer solutions.
- The constraints are small enough that complete search works:
- Loop through all values while .
- Solve for the other variable: .
- Check if are positive integers that satisfy the system of equations.
- Output
?
if zero or multiple solutions were found.
Comments