IN the problem ,my spoj.com/SPOJ/problems/VENOM/algorithm is giving the correct answer on ideone but NZEC in python.
I was suprised that there was no AC in python 2.7......please tell me the error..

import math
x=input()
for xx in xrange(x):
    s=raw_input()
    h,p,a=map(int,raw_input().split())
    y=(2*a)-(p)+math.sqrt((4*a*a)+(p*p)-(12*p*a)+(8*p*h))
    z=int(math.ceil(y/(2*p)))
    print (2*z-1)
    print
  • created

    Apr '15
  • last reply

    May '15
  • 1

    reply

  • 635

    views

  • 2

    users

  • 1

    link

29 days later

You should take care of corner cases. Given the fact that you use "math.sqrt" there is a more than obvious case.