title: How To Print Maximum Number Of A Using Given Four Keys
signature: how_to_print_maximum_number_of_a_using_given_four_keys <- function(n) {
test_code: 
  
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  validate_solution <- function(actual, expected) {
      toString(actual)==toString(expected)
  }
  
  driver <- function(n, expected){
      if (validate_solution(PLACEHOLDER_FN_NAME(n), expected)){
          "PASSED"
      } else{
          "FAILED"
      }
  }
  
  main <- function() {
      cat(sprintf("TEST-0...%s\n",driver(
          41L, 
          110592L
      )))
  
      cat(sprintf("TEST-1...%s\n",driver(
          94L, 
          274877906944L
      )))
  
      cat(sprintf("TEST-2...%s\n",driver(
          80L, 
          5435817984L
      )))
  
      cat(sprintf("TEST-3...%s\n",driver(
          40L, 
          82944L
      )))
  
      cat(sprintf("TEST-4...%s\n",driver(
          76L, 
          1811939328L
      )))
  
      cat(sprintf("TEST-5...%s\n",driver(
          5L, 
          5L
      )))
  
      cat(sprintf("TEST-6...%s\n",driver(
          43L, 
          196608L
      )))
  
      cat(sprintf("TEST-7...%s\n",driver(
          67L, 
          150994944L
      )))
  
      cat(sprintf("TEST-8...%s\n",driver(
          24L, 
          1024L
      )))
  
      cat(sprintf("TEST-9...%s\n",driver(
          90L, 
          86973087744L
      )))
  
  }
  
  main()
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 ];
  }