title: Number Days Tank Will Become Empty
signature: def numberDaysTankWillBecomeEmpty(c: Int, l: Int) = {
test_code: import scala.collection.mutable.HashMap
  import scala.collection.immutable.HashSet
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  
  // TESTING CODE 
  // ============================================
  def validateSolution(actual: Int , expected: Int): Boolean = {
      actual.toString == expected.toString
  }
  
  def driver(c: Int, l: Int, expected: Int): String = {
      try {
          if (validateSolution(PLACEHOLDER_FN_NAME(c, l),expected)) {
              "PASSED"
          } else{
              "FAILED"
          }
      }catch{
          case e: Exception => {e.getClass.getName}
      }
  
  }
  object QuestionEvaluator extends App {
  
      println(s"TEST-0...${driver(
        91, 29, 
        40    
      )}")   
  
  
      println(s"TEST-1...${driver(
        99, 55, 
        64    
      )}")   
  
  
      println(s"TEST-2...${driver(
        11, 56, 
        11    
      )}")   
  
  
      println(s"TEST-3...${driver(
        23, 56, 
        23    
      )}")   
  
  
      println(s"TEST-4...${driver(
        12, 97, 
        12    
      )}")   
  
  
      println(s"TEST-5...${driver(
        1, 64, 
        1    
      )}")   
  
  
      println(s"TEST-6...${driver(
        18, 5, 
        10    
      )}")   
  
  
      println(s"TEST-7...${driver(
        14, 37, 
        14    
      )}")   
  
  
      println(s"TEST-8...${driver(
        13, 55, 
        13    
      )}")   
  
  
      println(s"TEST-9...${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;
  }