https://www.codechef.com/viewsolution/18833187

this is link to my solution(for 25 points) for the problem

can anyone tell whats wrong with it?

also what’s the concept for 100 points

Try using long double… and print 10 digits after decimal… Even after that you get wrong answer then first check for logic and then for overflow…

Even typecast answer of sqrt() function…

You can see the editorial of VSN for 100 points soln… It’s as simple as getting 25…

Just u need one more “D” (2D+D)

There is two things that may be the problem:-

i.) In your quadratic equation you have not taken a corner case i.e if one root is zero and other root is positive then positive root will be answer. Your code if(t1<0) should be if(t1<=0),similarly else if(t2<=0). Although question says P & Q not visible initially but I took this corner case so you also run your code by doing above mentioned to know if that’s the error.

ii.) If your calculation part is correct then there may be precision problem.Use cout<<setprecision(6)…

how can i see the editorial for VSN

just type “VSN” over search option (“search here”) above your question on this page and hit Enter

### You will get a question named " VSN-Editorial "

### And this is how you can get **official editorial** for any question…

can’t be that error… cuz as u said it’s clearly mentioned that P and Q are not visible initially…

wtf @l_returns …xD. Never thought I’d hear “I think you need to have another D ;)” in a codingvplatform. Holy…xD

Haha xD.

Just wanted to convey that 100 points are as easy as 25…