title: Number Days Tank Will Become Empty
signature: numberDaysTankWillBecomeEmpty(c, l) {
test_code: import 'dart:convert';
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  bool validateSolution(int actual, int expected){
      return actual.toString() == expected.toString();
  }
  
  String driver(c, l, int expected){
      try
      {
          if (validateSolution(PLACEHOLDER_FN_NAME(c, l), expected)){
              return "PASSED";
          }
          return "FAILED";
      }catch(exception_object){
          return exception_object.runtimeType.toString();
      }
  }
  
  int main() {
  
      print("TEST-0...${driver(
          91, 29, 
          40)
      }");
  
      print("TEST-1...${driver(
          99, 55, 
          64)
      }");
  
      print("TEST-2...${driver(
          11, 56, 
          11)
      }");
  
      print("TEST-3...${driver(
          23, 56, 
          23)
      }");
  
      print("TEST-4...${driver(
          12, 97, 
          12)
      }");
  
      print("TEST-5...${driver(
          1, 64, 
          1)
      }");
  
      print("TEST-6...${driver(
          18, 5, 
          10)
      }");
  
      print("TEST-7...${driver(
          14, 37, 
          14)
      }");
  
      print("TEST-8...${driver(
          13, 55, 
          13)
      }");
  
      print("TEST-9...${driver(
          36, 99, 
          36)
      }");
  
      return 0;
  }
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;
  }