ENG  RUS Timus Online Judge
Online Judge
Problems
Authors
Online contests
Site news
Webboard
Problem set
Submit solution
Judge status
Guide
Register
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

## Discussion of Problem 1679. Scrooge's Tower

Nice Solution [Not Code]
Posted by Michail Yudin 18 Jan 2009 18:18
Heh, i take some day to solve this problem. Solution, by Master Herr Nikita Glashenko (Никита Глащенко), because my solution got (i move sqare from 0 to pi/2) TLE (slow code). Do next: take one point and mirror it in front of and sheer from O(0,0). Example: 3 4, -3-4, 4-3,-4 3. And take the equalization of the line catched on  two points(x1,y1) (x2,y2). if size of chord(lying on the line catched on  two points(x1,y1) (x2,y2))=r*sqrt(2)[use approximation 1e-7 for example] in one of the four variants (for four point, what you get), then 'yes' else 'no'.
PS: Division by zero mit uns(with us), you should control it.
Re: Nice Solution [Not Code]
Too difficult solution. All you should do for every case - just consider two squares...