Help required in an interesting geometry problem on Timus(1679. Scrooge's Tower)

Revision en1, by aditya_sheth, 2020-07-27 12:00:58

The problem asks to check if it is possible to rotate a square(of side length R*sqrt(2) in the problem) with fixed center(origin on 2-D plane) such that two points p1(x,y) and p2(x,y) lies on the border of square.

I have coded a solution using floating point operations, but it is failing on test #10.

It would be great help if anyone can help with a method using integer operations.

Tags #timus, #geometry

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English aditya_sheth 2020-07-27 12:00:58 525 Initial revision (published)