title: Number Days Tank Will Become Empty
signature: function number_days_tank_will_become_empty(c, l)
test_code: using Printf
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  function validate_solution(actual, expected)
      return actual == expected
  end
  
  function driver(c, l, expected)
      try
  
          if validate_solution(PLACEHOLDER_FN_NAME(c, l), expected)
              return "PASSED";
          end
          return "FAILED";
      catch exception_obj
          return string(Base.typename(typeof(exception_obj)).wrapper);
      end
  end
  
  function main()
      
      result = driver(91, 29, 40);
      @printf("TEST-0...%s\n",result);
      
      result = driver(99, 55, 64);
      @printf("TEST-1...%s\n",result);
      
      result = driver(11, 56, 11);
      @printf("TEST-2...%s\n",result);
      
      result = driver(23, 56, 23);
      @printf("TEST-3...%s\n",result);
      
      result = driver(12, 97, 12);
      @printf("TEST-4...%s\n",result);
      
      result = driver(1, 64, 1);
      @printf("TEST-5...%s\n",result);
      
      result = driver(18, 5, 10);
      @printf("TEST-6...%s\n",result);
      
      result = driver(14, 37, 14);
      @printf("TEST-7...%s\n",result);
      
      result = driver(13, 55, 13);
      @printf("TEST-8...%s\n",result);
      
      result = driver(36, 99, 36);
      @printf("TEST-9...%s\n",result);
      
  end
  
  main()
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;
  }