public static void main ( String [ ] args ) {
  Scanner in = new Scanner ( System . in ) ;
  int T = in . nextInt ( ) ;
  for ( int zz = 1 ;
  zz <= T ;
  zz ++ ) {
    int N = in . nextInt ( ) ;
    int K = in . nextInt ( ) ;
    long [ ] sum = new long [ N - K + 1 ] ;
    for ( int i = 0 ;
    i < sum . length ;
    i ++ ) sum [ i ] = in . nextInt ( ) ;
    long [ ] diff = new long [ N ] ;
    long [ ] A = new long [ K ] ;
    long [ ] B = new long [ K ] ;
    for ( int i = 0 ;
    i + 1 < sum . length ;
    i ++ ) {
      long d = sum [ i + 1 ] - sum [ i ] ;
      diff [ i + K ] = diff [ i ] + d ;
      A [ i % K ] = min ( A [ i % K ] , diff [ i + K ] ) ;
      B [ i % K ] = max ( B [ i % K ] , diff [ i + K ] ) ;
    }
    long total = 0 ;
    for ( int i = 0 ;
    i < K ;
    i ++ ) {
      total -= A [ i ] ;
      B [ i ] -= A [ i ] ;
      A [ i ] = 0 ;
    }
    Arrays . sort ( B ) ;
    long d = sum [ 0 ] - total ;
    d = ( ( d % K ) + K ) % K ;
    if ( d < 0 || d >= K ) throw new RuntimeException ( ) ;
    for ( long ans = B [ K - 1 ] ;
    ;
    ans ++ ) {
      long less = 0 ;
      for ( long b : B ) less += ans - b ;
      if ( less >= d ) {
        System . out . format ( "Case #%d: %d\n" , zz , ans ) ;
        break ;
      }
    }
  }
}

public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int T = in . nextInt ( ) ; for ( int zz = 1 ; zz <= T ; zz ++ ) { int N = in . nextInt ( ) ; int K = in . nextInt ( ) ; long [ ] sum = new long [ N - K + 1 ] ; for ( int i = 0 ; i < sum . length ; i ++ ) sum [ i ] = in . nextInt ( ) ; long [ ] diff = new long [ N ] ; long [ ] A = new long [ K ] ; long [ ] B = new long [ K ] ; for ( int i = 0 ; i + 1 < sum . length ; i ++ ) { long d = sum [ i + 1 ] - sum [ i ] ; diff [ i + K ] = diff [ i ] + d ; A [ i % K ] = min ( A [ i % K ] , diff [ i + K ] ) ; B [ i % K ] = max ( B [ i % K ] , diff [ i + K ] ) ; } long total = 0 ; for ( int i = 0 ; i < K ; i ++ ) { total -= A [ i ] ; B [ i ] -= A [ i ] ; A [ i ] = 0 ; } Arrays . sort ( B ) ; long d = sum [ 0 ] - total ; d = ( ( d % K ) + K ) % K ; if ( d < 0 || d >= K ) throw new RuntimeException ( ) ; for ( long ans = B [ K - 1 ] ; ; ans ++ ) { long less = 0 ; for ( long b : B ) less += ans - b ; if ( less >= d ) { System . out . format ( " Case ▁ # % d : ▁ % d \n " , zz , ans ) ; break ; } } } }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) body: (block (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (type_identifier) arguments: (argument_list (field_access object: (identifier) field: (identifier)))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (array_type element: (integral_type) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (decimal_integer_literal)))))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (field_access object: (identifier) field: (identifier))) update: (update_expression (identifier)) body: (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))))) (local_variable_declaration type: (array_type element: (integral_type) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (identifier))))) (local_variable_declaration type: (array_type element: (integral_type) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (identifier))))) (local_variable_declaration type: (array_type element: (integral_type) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (identifier))))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (field_access object: (identifier) field: (identifier))) update: (update_expression (identifier)) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (array_access array: (identifier) index: (identifier))))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (identifier))) right: (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (identifier)))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (identifier))) right: (method_invocation name: (identifier) arguments: (argument_list (array_access array: (identifier) index: (binary_expression left: (identifier) right: (identifier))) (array_access array: (identifier) index: (binary_expression left: (identifier) right: (identifier))))))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (identifier))) right: (method_invocation name: (identifier) arguments: (argument_list (array_access array: (identifier) index: (binary_expression left: (identifier) right: (identifier))) (array_access array: (identifier) index: (binary_expression left: (identifier) right: (identifier))))))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (block (expression_statement (assignment_expression left: (identifier) right: (array_access array: (identifier) index: (identifier)))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (array_access array: (identifier) index: (identifier)))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (decimal_integer_literal))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) right: (identifier))) right: (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (binary_expression left: (identifier) right: (identifier)))) consequence: (throw_statement (object_creation_expression type: (type_identifier) arguments: (argument_list)))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))))) update: (update_expression (identifier)) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (enhanced_for_statement type: (integral_type) name: (identifier) value: (identifier) body: (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (string_literal) (identifier) (identifier)))) (break_statement)))))))))