title: Find First Natural Number Whose Factorial Divisible X
signature: fun findFirstNaturalNumberWhoseFactorialDivisibleX(x: Int): Int {
test_code: package main
  
  import kotlin.text.*
  import kotlin.math.*
  
  
  // SOLUTION CODE
  // ===================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE
  // ===================================
  fun validateSolution(actual:Int, expected:Int):Boolean{
    return actual.equals(expected)
  }
  fun driver(x: Int, expected:Int):String {
      try{
        if (validateSolution(PLACEHOLDER_FN_NAME(x), expected)) {
                return "PASSED"
        }
        return "FAILED"
      } catch (e: Exception){
        return e::class.simpleName as String
      }
  
  }
  
  fun main() {
      var result: String = ""
      result = driver(67, 66)
      println("TEST-0...${result}")
      
      result = driver(47, 46)
      println("TEST-1...${result}")
      
      result = driver(57, 19)
      println("TEST-2...${result}")
      
      result = driver(89, 88)
      println("TEST-3...${result}")
      
      result = driver(67, 66)
      println("TEST-4...${result}")
      
      result = driver(40, 5)
      println("TEST-5...${result}")
      
      result = driver(16, 6)
      println("TEST-6...${result}")
      
      result = driver(83, 82)
      println("TEST-7...${result}")
      
      result = driver(93, 31)
      println("TEST-8...${result}")
      
      result = driver(43, 42)
      println("TEST-9...${result}")
      
          
  }
  
  main()
source_py: def find_first_natural_number_whose_factorial_divisible_x(x):
      i = 1
      fact = 1
      for i in range(1, x):
          fact = (fact * i)
          if ((fact % x) == 0):
              break
      return i
source_cpp: int find_first_natural_number_whose_factorial_divisible_x(int x) {
    int i = 1;
    int fact = 1;
    for ( i = 1;
    i < x;
    i ++ ) {
      fact = fact * i;
      if ( fact % x == 0 ) break;
    }
    return i;
  }