title: How To Print Maximum Number Of A Using Given Four Keys
signature: fun howToPrintMaximumNumberOfAUsingGivenFourKeys(n: Int): Long {
source_py: def how_to_print_maximum_number_of_a_using_given_four_keys(N):
      if (N <= 6):
          return N
      screen = ([0] * N)
      for n in range(1, 7):
          screen[(n - 1)] = n
      for n in range(7, (N + 1)):
          screen[(n - 1)] = max((2 * screen[(n - 4)]), max((3 * screen[(n - 5)]), (4 * screen[(n - 6)])))
      return screen[(N - 1)]
source_cpp: int how_to_print_maximum_number_of_a_using_given_four_keys(int N) {
    if ( N <= 6 ) return N;
    int screen [ N ];
    int b;
    int n;
    for ( n = 1;
    n <= 6;
    n ++ ) screen [ n - 1 ] = n;
    for ( n = 7;
    n <= N;
    n ++ ) {
      screen [ n - 1 ] = max ( 2 * screen [ n - 4 ], max ( 3 * screen [ n - 5 ], 4 * screen [ n - 6 ] ) );
    }
    return screen [ N - 1 ];
  }
question_info.test_list: [{"idx": 0, "outputs": 110592, "inputs": {"n": 41}}, {"idx": 1, "outputs": 274877906944, "inputs": {"n": 94}}, {"idx": 2, "outputs": 5435817984, "inputs": {"n": 80}}, {"idx": 3, "outputs": 82944, "inputs": {"n": 40}}, {"idx": 4, "outputs": 1811939328, "inputs": {"n": 76}}, {"idx": 5, "outputs": 5, "inputs": {"n": 5}}, {"idx": 6, "outputs": 196608, "inputs": {"n": 43}}, {"idx": 7, "outputs": 150994944, "inputs": {"n": 67}}, {"idx": 8, "outputs": 1024, "inputs": {"n": 24}}, {"idx": 9, "outputs": 86973087744, "inputs": {"n": 90}}]
question_info.extension: kts
question_info.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, expected:Long):String {
      try{
        if (validateSolution(PLACEHOLDER_FN_NAME(n), expected)) {
                return "PASSED"
        }
        return "FAILED"
      } catch (e: Exception){
        return e::class.simpleName as String
      }
  
  }
  
  fun main() {
      var result: String = ""
      result = driver(41, 110592)
      println("TEST-0...${result}")
      
      result = driver(94, 274877906944)
      println("TEST-1...${result}")
      
      result = driver(80, 5435817984)
      println("TEST-2...${result}")
      
      result = driver(40, 82944)
      println("TEST-3...${result}")
      
      result = driver(76, 1811939328)
      println("TEST-4...${result}")
      
      result = driver(5, 5)
      println("TEST-5...${result}")
      
      result = driver(43, 196608)
      println("TEST-6...${result}")
      
      result = driver(67, 150994944)
      println("TEST-7...${result}")
      
      result = driver(24, 1024)
      println("TEST-8...${result}")
      
      result = driver(90, 86973087744)
      println("TEST-9...${result}")
      
          
  }
  
  main()
question_info.entry_fn_name: howToPrintMaximumNumberOfAUsingGivenFourKeys
question_info.entry_cls_name: Solution
question_info.test_case_ids: 0 1 2 3 4 5 6 7 8 9
question_info.commands: kotlinc -script __FILENAME__ -no-reflect -nowarn