anchor.diff:  
   This looks pretty good. Is there anything else that can be improved upon? Well, if you notice the figure carefully, we dont have to iterate \(x\) from \([0, \sqrt(n)]\). All points on one side of line \(y = x\) are mirror images of points on the other side. i.e., if we find a point, day \((3, 4)\) then we will find a mirror \((4, 3)\) on the other side. Since the problem doesn't differentiate between these two solutions, it is sufficient if we iterate \(x\) from \([0, x']\), where \(x'\) is given by \(\sqrt{n} \cos{45} = \sqrt{n/2}\).
   
  -image::post1/fig3.png[Line \(y = x\) acts as a mirror]
  +.Line \(y = x\) acts as a mirror
  +image::post1/fig3.png[align="center"]
   
   With this, we can complete the algorithm in java as follows:
   
  
positive.code: 
  Testing all possible integral pairs of \((x, y)\) upto \(N\) is equivalent to searching within the greyed geometric square as illustrated.
  
  image::post1/fig1.png[Geometric view of double squares problem]
  
  Algorithmically, this approach takes \(O(n^2)\) time. Consider the sample input as shown below (this was the file I received)
  
  
negative.code: }
  ----
  
  This algorithm works in \(O(\sqrt{n/2}) \sim O(\sqrt{n})\). This only takes 0.047 secs to execute!