This problem is a programming version of Problem 66 from projecteuler.net
Consider quadratic Diophantine equations of the form:
For example, when , the minimal solution in is . It can be assumed that there are no solutions in positive integers when D is square.
By finding minimal solutions in for , we obtain the following:
Hence, by considering minimal solutions in for , the largest is obtained when .
Find the value of in minimal solutions of for which the largest value of is obtained.
Input contains an integer .
Print the answer corresponding to the test case.
Explained in statement.