This is just to avoid any confusion about the input and output formats: is it safe to assume that the numbers in the input file are separated by exactly one space? And lines are sperated by exactly one new line (\\n)? Also, is the last line of numbers have a new line (\\n) at the end? If so, should we assume that the last line of an input file is a line of numbers ended with a new line, that is there are no extra lines (\\n) other than the one ending the last line of numbers?
The output format looks straightforward, just the solution upper left and lower right indicies with the x component printed first, and each solution is on a newline. Please correct me if I am wrong.