tl;dr
A few constraints were given in one line, this can be expanded into 6 different constraints, 2 sets of 3.
Each set has a pell-like equation, a size and a have one variable as a prime. Integer solutions to Pell's equation can easily be found, and using the bounds only one solution came out.
The solutions are then converted into the flag