title: Number Days Tank Will Become Empty
signature: fun numberDaysTankWillBecomeEmpty(c: Int, l: Int): Int {
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;
  }
question_info.test_list: [{"idx": 0, "outputs": 40, "inputs": {"c": 91, "l": 29}}, {"idx": 1, "outputs": 64, "inputs": {"c": 99, "l": 55}}, {"idx": 2, "outputs": 11, "inputs": {"c": 11, "l": 56}}, {"idx": 3, "outputs": 23, "inputs": {"c": 23, "l": 56}}, {"idx": 4, "outputs": 12, "inputs": {"c": 12, "l": 97}}, {"idx": 5, "outputs": 1, "inputs": {"c": 1, "l": 64}}, {"idx": 6, "outputs": 10, "inputs": {"c": 18, "l": 5}}, {"idx": 7, "outputs": 14, "inputs": {"c": 14, "l": 37}}, {"idx": 8, "outputs": 13, "inputs": {"c": 13, "l": 55}}, {"idx": 9, "outputs": 36, "inputs": {"c": 36, "l": 99}}]
question_info.extension: kts
question_info.test_code: package main
  
  import kotlin.text.*
  import kotlin.math.*
  
  
  // SOLUTION CODE
  // ===================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE
  // ===================================
  fun validateSolution(actual:Int, expected:Int):Boolean{
    return actual.equals(expected)
  }
  fun driver(c: Int, l: Int, expected:Int):String {
      try{
        if (validateSolution(PLACEHOLDER_FN_NAME(c, l), expected)) {
                return "PASSED"
        }
        return "FAILED"
      } catch (e: Exception){
        return e::class.simpleName as String
      }
  
  }
  
  fun main() {
      var result: String = ""
      result = driver(91, 29, 40)
      println("TEST-0...${result}")
      
      result = driver(99, 55, 64)
      println("TEST-1...${result}")
      
      result = driver(11, 56, 11)
      println("TEST-2...${result}")
      
      result = driver(23, 56, 23)
      println("TEST-3...${result}")
      
      result = driver(12, 97, 12)
      println("TEST-4...${result}")
      
      result = driver(1, 64, 1)
      println("TEST-5...${result}")
      
      result = driver(18, 5, 10)
      println("TEST-6...${result}")
      
      result = driver(14, 37, 14)
      println("TEST-7...${result}")
      
      result = driver(13, 55, 13)
      println("TEST-8...${result}")
      
      result = driver(36, 99, 36)
      println("TEST-9...${result}")
      
          
  }
  
  main()
question_info.entry_fn_name: numberDaysTankWillBecomeEmpty
question_info.entry_cls_name: Solution
question_info.test_case_ids: 0 1 2 3 4 5 6 7 8 9
question_info.commands: kotlinc -script __FILENAME__ -no-reflect -nowarn