Hey, guys, it is not serious, really ...... I had wa4 with EPS = 1e8 .... when I've changed EPS = 1e6 I got AC... Edited by author 06.02.2014 18:13 give some tests plz 1 35 0 25 21 22 Answer YES Edited by author 12.04.2009 20:28 I think that the correct answer here is NO wtf Edited by author 12.04.2009 20:32 I'm sorry, I made mistake. Though my lying AC programm writes "YES" ((((. Test is changed. Maybe answer on test 1 35 0 25 22 21 is also "YES" ? Anybody, check it, plz. Hi, My program gives "YES", I got WA#12 also. Any ideas? AC program. answer is YES Hello, ladies and gentlemens. Can somebody help me? My program compiles on my computer (Delphi 6), but when i send it to judge, i get message 'Crash (floatingpoint invalid operation)'. How i can solve this problem? what is wrong? Check that you do not divide to 0. (For example when x1=x2) Please, give me the first test. My program work right, but wrong answer already on the first test. pls, give me some tests I've too have this problem:) Well, I had this problem, too. This is caused by a small bug, that is very silly. You must have written something like this: if (xA * xA + yA * yA < R * R / 2) cout<<"NO"<<endl; However, the solution should be like this: if ((xA * xA + yA * yA) * 2 < R * R) cout<<"NO"<<endl; What a stupid mistake! Good luck :) A got AC using real numbers with EPS = 1e8, so precision is not major matter here... i think it is safe to rotate point 1 90 degrees 4 times and check if it is possible to align the rotated point 1 with point 2 to form an edge of the square. rotated point1 will also have integer coordinates. Thanks, Neal Zane! Your idea is fruitful indeed. I've already gave up to overcome test#24, where float calculations seem to be very sensitive to precesion. And tan/atan along with sqrt gave me error of 10^8. Now totally integer solution is concise and fast! Thanks for idea. Simple and beautiful. My previous AC solution was more difficult. I have tried this way. When I used the formula 2*(y0*x1  y1*x0)^2 ? R^2*((x1  x0)^2 + (y1  y0)^2) (with 3 x < y, y < x) (with long long on right side) has received WA 3. My previous right solution with use of floats has no more lines and operations. Therefore I believe that geometrical problems to solve in the habitual ways (via floats with epsilon) more preferably. It is necessary to use a "wheel", instead of to invent something new when good average speed of the decision of a problem is necessary. I was very surprised, when after WA1 and WA 2 my solution was accepted :) Pay attention to the situation, when points becomes the same. Pay attention to the situation, when points becomes the same. Thanks! Very useful hint! I tried to solve with some float precisions but it was always WA. Then it was written using only integer calculations and AC. I got AC using doubles But integer solution really nice ;) I think that integer method is nice because it mathematically easy proved Float method has only timusAc verification and there for less nice. I tried to find regorious analysis of some float algo based on computer float system theory but it is rather difficult. I totally agree  very interesting problem with integer solution. Edited by author 18.10.2009 15:59 Give me some test, please. I thought out many tests, but my program always gives right answers. I need test for WRONG ANSWER!!! Edited by author 18.01.2009 15:26 Yeh, but if do the more rules for input control... program go to wa2.... fuck. Test! Anybody. thx a lot. For Michail Yudin. Messages should not contain offences, obscene words and correct solutions. Heh... Edited by author 12.01.2009 11:45 For Michail Yudin. Messages should not contain offences, obscene words and correct solutions. Heh... Edited by author 12.01.2009 11:45 You program should not contain mistakes.... Heh... Edited by author 27.10.2012 23:03 My advice. Break off double at all. Use __int64 instead. For example. sqrt(x*x+y*y)<=R ~ (x*x+y*y)<=R*R. On this way you can make you algo absolutely i.e, mathematically correctly. Эх, это не идея... Так только уберет совсем невозможные варианты. Это реализовано мной... Wa10. Я попробовал проверить приндлежность двух точек одному потенциально возможному в окружности с данным радиусом вписанному квадрату... и получил wa2. полный трындец... можно конечно понасиловать тимус, чтобы добыть тесты... но это плохой дао. так как старость может придти раньше успеха. Ктонибудь дайте ACалгоритм, или его математическую реализацию.... я больше не могу ничего придумать PS. if you want translate... use RUEN translator. Use for example a system: s*x1+t*y1==R/sqrt(2) s*x2+t*y2==R/sqrt(2) must be:s^2+t^2==1 Thx a lot... True algo. How do you got it Wise man? if it not secret. But test 9 5 5 5 5 this algo do bad. correct answer  yes. answer this algo  no Edited by author 16.01.2009 23:00 Edited by author 16.01.2009 23:01 Edited by author 16.01.2009 23:02 My advice. Break off double at all. Use __int64 instead. For example. sqrt(x*x+y*y)<=R ~ (x*x+y*y)<=R*R. On this way you can make you algo absolutely i.e, mathematically correctly. What does this formula stand for? I don't know what is "~" here? Is this enough to solve the problem, or is there anything else to be considered? Thanks many questions! see my site svrsvr.far.ru at this place a will give full explanations soon 2 9 5 5 5 5 9 5 5 5 5 YES YES
Thanks, but my program gives the same answers. What is the test or how did you circumvent it? This is a big random test with big circles. Probably you solution is not precise enough. 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, 34, 43,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 1e7 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. Too difficult solution. All you should do for every case  just consider two squares... Edited by author 18.01.2009 18:00 WA24 Edited by author 14.01.2009 04:25 Edited by author 14.01.2009 04:26 I understood this test. It's test give two points and check, one square has it, or each point is belonged to two sifferent squares, what maybe constructed in this circle. How can i check it? I need mathematic model. Thx. Why for 2 1 1 0 0 the answer is NO ? Because the point (0,0) can't belong to our square. The distance from (0,0) to each of 2 points should be R*sqrt(2)/2 <= d1,d2 < R R*sqrt(2)/2 <= d1,d2 <= R why in sample input answer for test 2 is NO? and if it is NO why answer for 3test 3 is YES? is anybody here ?! test#2 contains a point (0;0) which cannot belong to the inscribed square, that's obvious. "square of the foundation should be inscribed in the circle of the island" what does "inscribe" mean here? does it mean that the corners of square should lie on the circle? yes, this is what the term "inscribed" means i don't understand why it's "yes" for the first variant Square ABCD: A(2,0),B(0,2),C(2,0),D(0,2) Sample 1 gives the middle point of AB and AD i don't understand why it's "yes" for the first variant why the second test is NO ? 
