fork download
  1. main = readLn >>= \kolvo -> let
  2. reshenie = najdiNuljEpt (\x -> 2*x*(x+1)*(x+2) - 12*kolvo) 1
  3. in print (floor reshenie)
  4.  
  5. najdiNuljEpt f = (!!56) . iterate (\xi -> xi - f xi/dfdx f xi)
  6.  
  7. dfdx f x = (f (x+h) - f x)/h
  8. h = 1/10^6
Success #stdin #stdout 0s 6320KB
stdin
1488
stdout
19