Sir,
http://www.codechef.com/viewsolution/5155858 this is the link of my solution
Thanks.
Brother, it returns -0.40
for
50 50.10
You need to check if( ((x%5)==0) && (y>=(x+0.5))
, for correct answer .
6 Likes
instead of if((double)x>(y+0.5)||x%5!=0) you should use if((double)x>(y+0.5)&& x%5!=0) as here you need follow both the conditions.
1 Like