title: Count Numbers Can Constructed Using Two Numbers
signature: class Solution {
  
      public int CountNumbersCanConstructedUsingTwoNumbers(int n, int x, int y) {
test_code: using System;
  using System.Numerics;
  using System.Diagnostics;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using System.Security.Cryptography;
  using System.Web.UI;
  using System.Web.Script.Serialization;
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  namespace EvaluatePrediction {
      class TestRunner {
          public bool ValidateSolution(int actual, int expected){
              return new JavaScriptSerializer().Serialize(actual) == new JavaScriptSerializer().Serialize(expected);
          }
  
          public string driver(int n, int x, int y, int expected){
              try{
                PLACEHOLDER_CLS_NAME solution_cls = new PLACEHOLDER_CLS_NAME();
                int pred_result = solution_cls.PLACEHOLDER_FN_NAME(n, x, y); 
                if (ValidateSolution(
                      pred_result,
                      expected)){
                  return "PASSED";
                }
                return "FAILED";
              } 
              catch (Exception exception_obj)
              {
                return exception_obj.GetType().FullName;
              }
          }
          static void Main(string[] args) {
              TestRunner runner = new TestRunner();
              String result;
              result = runner.driver(
                  23, 16, 16, 
                  1
              );
              Console.WriteLine(string.Format(
                  "TEST-0...{0}",
                  result)
              );result = runner.driver(
                  56, 95, 6, 
                  9
              );
              Console.WriteLine(string.Format(
                  "TEST-1...{0}",
                  result)
              );result = runner.driver(
                  30, 63, 1, 
                  30
              );
              Console.WriteLine(string.Format(
                  "TEST-2...{0}",
                  result)
              );result = runner.driver(
                  51, 89, 46, 
                  1
              );
              Console.WriteLine(string.Format(
                  "TEST-3...{0}",
                  result)
              );result = runner.driver(
                  21, 99, 38, 
                  0
              );
              Console.WriteLine(string.Format(
                  "TEST-4...{0}",
                  result)
              );result = runner.driver(
                  69, 63, 50, 
                  2
              );
              Console.WriteLine(string.Format(
                  "TEST-5...{0}",
                  result)
              );result = runner.driver(
                  12, 69, 73, 
                  0
              );
              Console.WriteLine(string.Format(
                  "TEST-6...{0}",
                  result)
              );result = runner.driver(
                  44, 52, 9, 
                  4
              );
              Console.WriteLine(string.Format(
                  "TEST-7...{0}",
                  result)
              );result = runner.driver(
                  99, 65, 10, 
                  13
              );
              Console.WriteLine(string.Format(
                  "TEST-8...{0}",
                  result)
              );result = runner.driver(
                  46, 58, 37, 
                  1
              );
              Console.WriteLine(string.Format(
                  "TEST-9...{0}",
                  result)
              );
          }
      }
  }
  
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;
  }