title: Count Number Ways Tile Floor Size N X M Using 1 X M Size Tiles
signature: class Solution {
  
      public long CountNumberWaysTileFloorSizeNXMUsing1XMSizeTiles(int n, int m) {
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(long actual, long expected){
              return new JavaScriptSerializer().Serialize(actual) == new JavaScriptSerializer().Serialize(expected);
          }
  
          public string driver(int n, int m, long expected){
              try{
                PLACEHOLDER_CLS_NAME solution_cls = new PLACEHOLDER_CLS_NAME();
                long pred_result = solution_cls.PLACEHOLDER_FN_NAME(n, m); 
                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(
                  93, 54, 
                  41
              );
              Console.WriteLine(string.Format(
                  "TEST-0...{0}",
                  result)
              );result = runner.driver(
                  17, 4, 
                  131
              );
              Console.WriteLine(string.Format(
                  "TEST-1...{0}",
                  result)
              );result = runner.driver(
                  38, 39, 
                  1
              );
              Console.WriteLine(string.Format(
                  "TEST-2...{0}",
                  result)
              );result = runner.driver(
                  33, 64, 
                  1
              );
              Console.WriteLine(string.Format(
                  "TEST-3...{0}",
                  result)
              );result = runner.driver(
                  78, 35, 
                  90
              );
              Console.WriteLine(string.Format(
                  "TEST-4...{0}",
                  result)
              );result = runner.driver(
                  40, 61, 
                  1
              );
              Console.WriteLine(string.Format(
                  "TEST-5...{0}",
                  result)
              );result = runner.driver(
                  95, 6, 
                  10665883415
              );
              Console.WriteLine(string.Format(
                  "TEST-6...{0}",
                  result)
              );result = runner.driver(
                  12, 8, 
                  6
              );
              Console.WriteLine(string.Format(
                  "TEST-7...{0}",
                  result)
              );result = runner.driver(
                  69, 60, 
                  11
              );
              Console.WriteLine(string.Format(
                  "TEST-8...{0}",
                  result)
              );result = runner.driver(
                  78, 21, 
                  1578
              );
              Console.WriteLine(string.Format(
                  "TEST-9...{0}",
                  result)
              );
          }
      }
  }
  
source_py: def count_number_ways_tile_floor_size_n_x_m_using_1_x_m_size_tiles(n, m):
      count = []
      for i in range((n + 2)):
          count.append(0)
      count[0] = 0
      for i in range(1, (n + 1)):
          if (i > m):
              count[i] = (count[(i - 1)] + count[(i - m)])
          elif (i < m):
              count[i] = 1
          else:
              count[i] = 2
      return count[n]
source_cpp: int count_number_ways_tile_floor_size_n_x_m_using_1_x_m_size_tiles(int n, int m) {
    int count [ n + 1 ];
    count [ 0 ] = 0;
    for ( int i = 1;
    i <= n;
    i ++ ) {
      if ( i > m ) count [ i ] = count [ i - 1 ] + count [ i - m ];
      else if ( i < m ) count [ i ] = 1;
      else count [ i ] = 2;
    }
    return count [ n ];
  }