title: Number Days Tank Will Become Empty
signature: class Solution {
  
      public Integer numberDaysTankWillBecomeEmpty(Integer c, Integer l) {
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.extension: java
question_info.entry_fn_name: numberDaysTankWillBecomeEmpty
question_info.entry_cls_name: Solution
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.test_code: import static java.util.Map.entry;  
  import java.util.*;
  import java.lang.*;
  // TESTING CODE 
  // ============================================
  class QuestionEvaluator {
      public static String validateSolution(Integer c, Integer l, Integer expected){
          try{
              Driver driver = new Driver();
              if (driver.run(c, l,expected)){
                  return "PASSED";
              }
              return "FAILED";
              
          } catch (Exception exception_obj){
              return exception_obj.getClass().getSimpleName();
          }
  
      }
      public static void main(String[] args) {
          String result;
          result = validateSolution(91, 29, 40);
          System.out.println(String.format("%s%s","TEST-0...",result));    
      
          result = validateSolution(99, 55, 64);
          System.out.println(String.format("%s%s","TEST-1...",result));    
      
          result = validateSolution(11, 56, 11);
          System.out.println(String.format("%s%s","TEST-2...",result));    
      
          result = validateSolution(23, 56, 23);
          System.out.println(String.format("%s%s","TEST-3...",result));    
      
          result = validateSolution(12, 97, 12);
          System.out.println(String.format("%s%s","TEST-4...",result));    
      
          result = validateSolution(1, 64, 1);
          System.out.println(String.format("%s%s","TEST-5...",result));    
      
          result = validateSolution(18, 5, 10);
          System.out.println(String.format("%s%s","TEST-6...",result));    
      
          result = validateSolution(14, 37, 14);
          System.out.println(String.format("%s%s","TEST-7...",result));    
      
          result = validateSolution(13, 55, 13);
          System.out.println(String.format("%s%s","TEST-8...",result));    
      
          result = validateSolution(36, 99, 36);
          System.out.println(String.format("%s%s","TEST-9...",result));    
      
      }
  }
  
  class Driver{
      public boolean run(Integer c, Integer l, Integer expected){
  
          PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();
          return validateSolution(sol.PLACEHOLDER_FN_NAME(c, l),expected);
      }
      
      public boolean validateSolution(Integer actual, Integer expected){
          return actual.equals(expected);
      }
  }
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
question_info.test_case_ids: 0 1 2 3 4 5 6 7 8 9
question_info.commands: java __FILENAME__