title: Number Days Tank Will Become Empty
signature: numberDaysTankWillBecomeEmpty :: Integer -> Integer -> Integer
  numberDaysTankWillBecomeEmpty c l = 
test_code: import Text.Printf
  import Control.Exception (catch, SomeException)
  import Data.Typeable
  import qualified Data.List as List
  import qualified Data.Map as Map
  import qualified Data.Set as Set
  
  -- SOLUTION CODE
  -- ============================================
  
  PLACEHOLDER_CODE_BODY
  
  -- TESTING CODE 
  -- ============================================
  validateSolution :: Integer -> Integer -> Bool
  validateSolution actual expected = do
      actual == expected
  
  
  driver :: Integer -> Integer -> Integer -> String
  driver c l expected = do
      if (validateSolution (PLACEHOLDER_FN_NAME c l) expected)
          then "PASSED"
      else "FAILED"
  
  main = do
      printf "TEST-0...%s\n" (driver (91) (29) (40) )
  
      printf "TEST-1...%s\n" (driver (99) (55) (64) )
  
      printf "TEST-2...%s\n" (driver (11) (56) (11) )
  
      printf "TEST-3...%s\n" (driver (23) (56) (23) )
  
      printf "TEST-4...%s\n" (driver (12) (97) (12) )
  
      printf "TEST-5...%s\n" (driver (1) (64) (1) )
  
      printf "TEST-6...%s\n" (driver (18) (5) (10) )
  
      printf "TEST-7...%s\n" (driver (14) (37) (14) )
  
      printf "TEST-8...%s\n" (driver (13) (55) (13) )
  
      printf "TEST-9...%s\n" (driver (36) (99) (36) )
  
source_py: def number_days_tank_will_become_empty(C, l):
      if (l >= C):
          return C
      eq_root = ((math.sqrt((1 + (8 * (C - l)))) - 1) / 2)
      return (math.ceil(eq_root) + l)
source_cpp: int number_days_tank_will_become_empty(int C, int l) {
    if ( l >= C ) return C;
    double eq_root = ( std :: sqrt ( 1 + 8 * ( C - l ) ) - 1 ) / 2;
    return std :: ceil ( eq_root ) + l;
  }