title: How To Print Maximum Number Of A Using Given Four Keys
signature: class Solution {
  
      public Long howToPrintMaximumNumberOfAUsingGivenFourKeys(Integer n) {
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.extension: java
question_info.entry_fn_name: howToPrintMaximumNumberOfAUsingGivenFourKeys
question_info.entry_cls_name: Solution
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.test_code: import static java.util.Map.entry;  
  import java.util.*;
  import java.lang.*;
  // TESTING CODE 
  // ============================================
  class QuestionEvaluator {
      public static String validateSolution(Integer n, Long expected){
          try{
              Driver driver = new Driver();
              if (driver.run(n,expected)){
                  return "PASSED";
              }
              return "FAILED";
              
          } catch (Exception exception_obj){
              return exception_obj.getClass().getSimpleName();
          }
  
      }
      public static void main(String[] args) {
          String result;
          result = validateSolution(41, 110592L);
          System.out.println(String.format("%s%s","TEST-0...",result));    
      
          result = validateSolution(94, 274877906944L);
          System.out.println(String.format("%s%s","TEST-1...",result));    
      
          result = validateSolution(80, 5435817984L);
          System.out.println(String.format("%s%s","TEST-2...",result));    
      
          result = validateSolution(40, 82944L);
          System.out.println(String.format("%s%s","TEST-3...",result));    
      
          result = validateSolution(76, 1811939328L);
          System.out.println(String.format("%s%s","TEST-4...",result));    
      
          result = validateSolution(5, 5L);
          System.out.println(String.format("%s%s","TEST-5...",result));    
      
          result = validateSolution(43, 196608L);
          System.out.println(String.format("%s%s","TEST-6...",result));    
      
          result = validateSolution(67, 150994944L);
          System.out.println(String.format("%s%s","TEST-7...",result));    
      
          result = validateSolution(24, 1024L);
          System.out.println(String.format("%s%s","TEST-8...",result));    
      
          result = validateSolution(90, 86973087744L);
          System.out.println(String.format("%s%s","TEST-9...",result));    
      
      }
  }
  
  class Driver{
      public boolean run(Integer n, Long expected){
  
          PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();
          return validateSolution(sol.PLACEHOLDER_FN_NAME(n),expected);
      }
      
      public boolean validateSolution(Long actual, Long expected){
          return actual.equals(expected);
      }
  }
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
question_info.test_case_ids: 0 1 2 3 4 5 6 7 8 9
question_info.commands: java __FILENAME__