title: Count Number Ways Tile Floor Size N X M Using 1 X M Size Tiles
signature: fun countNumberWaysTileFloorSizeNXMUsing1XMSizeTiles(n: Int, m: Int): Long {
test_code: package main
  
  import kotlin.text.*
  import kotlin.math.*
  
  
  // SOLUTION CODE
  // ===================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE
  // ===================================
  fun validateSolution(actual:Long, expected:Long):Boolean{
    return actual.equals(expected)
  }
  fun driver(n: Int, m: Int, expected:Long):String {
      try{
        if (validateSolution(PLACEHOLDER_FN_NAME(n, m), expected)) {
                return "PASSED"
        }
        return "FAILED"
      } catch (e: Exception){
        return e::class.simpleName as String
      }
  
  }
  
  fun main() {
      var result: String = ""
      result = driver(93, 54, 41)
      println("TEST-0...${result}")
      
      result = driver(17, 4, 131)
      println("TEST-1...${result}")
      
      result = driver(38, 39, 1)
      println("TEST-2...${result}")
      
      result = driver(33, 64, 1)
      println("TEST-3...${result}")
      
      result = driver(78, 35, 90)
      println("TEST-4...${result}")
      
      result = driver(40, 61, 1)
      println("TEST-5...${result}")
      
      result = driver(95, 6, 10665883415)
      println("TEST-6...${result}")
      
      result = driver(12, 8, 6)
      println("TEST-7...${result}")
      
      result = driver(69, 60, 11)
      println("TEST-8...${result}")
      
      result = driver(78, 21, 1578)
      println("TEST-9...${result}")
      
          
  }
  
  main()
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 ];
  }