title: Count Numbers Can Constructed Using Two Numbers
signature: pub fn count_numbers_can_constructed_using_two_numbers(n: i32, x: i32, y: 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(n: i32, x: i32, y: i32, expected: i32)->String{
      if validate_solution(PLACEHOLDER_FN_NAME(n, x, y), expected) {
        return "PASSED".to_string();
      };
      return "FAILED".to_string();
  
  }
  
  fn main() {
      println!("TEST-0...{}", driver(
        23, 16, 16, 
        1
      ));
      
      println!("TEST-1...{}", driver(
        56, 95, 6, 
        9
      ));
      
      println!("TEST-2...{}", driver(
        30, 63, 1, 
        30
      ));
      
      println!("TEST-3...{}", driver(
        51, 89, 46, 
        1
      ));
      
      println!("TEST-4...{}", driver(
        21, 99, 38, 
        0
      ));
      
      println!("TEST-5...{}", driver(
        69, 63, 50, 
        2
      ));
      
      println!("TEST-6...{}", driver(
        12, 69, 73, 
        0
      ));
      
      println!("TEST-7...{}", driver(
        44, 52, 9, 
        4
      ));
      
      println!("TEST-8...{}", driver(
        99, 65, 10, 
        13
      ));
      
      println!("TEST-9...{}", driver(
        46, 58, 37, 
        1
      ));
      
  }
source_py: def count_numbers_can_constructed_using_two_numbers(n, x, y):
      arr = [False for i in range((n + 2))]
      if (x <= n):
          arr[x] = True
      if (y <= n):
          arr[y] = True
      result = 0
      for i in range(min(x, y), (n + 1)):
          if arr[i]:
              if ((i + x) <= n):
                  arr[(i + x)] = True
              if ((i + y) <= n):
                  arr[(i + y)] = True
              result = (result + 1)
      return result
source_cpp: int count_numbers_can_constructed_using_two_numbers(int n, int x, int y) {
    vector < bool > arr ( n + 1, false );
    if ( x <= n ) arr [ x ] = true;
    if ( y <= n ) arr [ y ] = true;
    int result = 0;
    for ( int i = min ( x, y );
    i <= n;
    i ++ ) {
      if ( arr [ i ] ) {
        if ( i + x <= n ) arr [ i + x ] = true;
        if ( i + y <= n ) arr [ i + y ] = true;
        result ++;
      }
    }
    return result;
  }