title: Number Days Tank Will Become Empty
signature: pub fn number_days_tank_will_become_empty(c: i32, l: i32) -> i32 {
test_code: use std::collections::HashMap;
  use std::collections::HashSet;
  use std::cmp::*;
  use std::collections::*;
  use std::fmt::*; 
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  pub fn validate_solution(actual: i32, expected: i32)->bool{
  return actual==expected
  }
  pub fn driver(c: i32, l: i32, expected: i32)->String{
      if validate_solution(PLACEHOLDER_FN_NAME(c, l), expected) {
        return "PASSED".to_string();
      };
      return "FAILED".to_string();
  
  }
  
  fn main() {
      println!("TEST-0...{}", driver(
        91, 29, 
        40
      ));
      
      println!("TEST-1...{}", driver(
        99, 55, 
        64
      ));
      
      println!("TEST-2...{}", driver(
        11, 56, 
        11
      ));
      
      println!("TEST-3...{}", driver(
        23, 56, 
        23
      ));
      
      println!("TEST-4...{}", driver(
        12, 97, 
        12
      ));
      
      println!("TEST-5...{}", driver(
        1, 64, 
        1
      ));
      
      println!("TEST-6...{}", driver(
        18, 5, 
        10
      ));
      
      println!("TEST-7...{}", driver(
        14, 37, 
        14
      ));
      
      println!("TEST-8...{}", driver(
        13, 55, 
        13
      ));
      
      println!("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;
  }