public static void main ( String args [ ] ) throws Exception {
  String inFile = "B-large.in" ;
  String outFile = inFile + ".out" ;
  LineNumberReader lin = new LineNumberReader ( new InputStreamReader ( new FileInputStream ( inFile ) ) ) ;
  PrintWriter out = new PrintWriter ( new File ( outFile ) ) ;
  int NCASE = Integer . parseInt ( lin . readLine ( ) ) ;
  for ( int CASE = 1 ;
  CASE <= NCASE ;
  CASE ++ ) {
    out . print ( "Case #" + CASE + ": " ) ;
    String l = lin . readLine ( ) ;
    String ll [ ] = l . split ( " " ) ;
    int N = Integer . parseInt ( ll [ 0 ] ) ;
    BigInteger t [ ] = new BigInteger [ N ] ;
    for ( int i = 0 ;
    i < N ;
    i ++ ) t [ i ] = new BigInteger ( ll [ i + 1 ] ) ;
    BigInteger T = null ;
    for ( int a = 0 ;
    a < N ;
    a ++ ) for ( int b = a ;
    ++ b < N ;
    ) {
      BigInteger d = t [ a ] . subtract ( t [ b ] ) . abs ( ) ;
      if ( T == null ) T = d ;
      else T = T . gcd ( d ) ;
    }
    BigInteger y = t [ 0 ] . mod ( T ) ;
    if ( ! y . equals ( BigInteger . ZERO ) ) y = T . subtract ( y ) ;
    out . println ( y ) ;
  }
  lin . close ( ) ;
  out . close ( ) ;
}

public static void main ( String args [ ] ) throws Exception { String inFile = " B - large . in " ; String outFile = inFile + " . out " ; LineNumberReader lin = new LineNumberReader ( new InputStreamReader ( new FileInputStream ( inFile ) ) ) ; PrintWriter out = new PrintWriter ( new File ( outFile ) ) ; int NCASE = Integer . parseInt ( lin . readLine ( ) ) ; for ( int CASE = 1 ; CASE <= NCASE ; CASE ++ ) { out . print ( " Case ▁ # " + CASE + " : ▁ " ) ; String l = lin . readLine ( ) ; String ll [ ] = l . split ( " ▁ " ) ; int N = Integer . parseInt ( ll [ 0 ] ) ; BigInteger t [ ] = new BigInteger [ N ] ; for ( int i = 0 ; i < N ; i ++ ) t [ i ] = new BigInteger ( ll [ i + 1 ] ) ; BigInteger T = null ; for ( int a = 0 ; a < N ; a ++ ) for ( int b = a ; ++ b < N ; ) { BigInteger d = t [ a ] . subtract ( t [ b ] ) . abs ( ) ; if ( T == null ) T = d ; else T = T . gcd ( d ) ; } BigInteger y = t [ 0 ] . mod ( T ) ; if ( ! y . equals ( BigInteger . ZERO ) ) y = T . subtract ( y ) ; out . println ( y ) ; } lin . close ( ) ; out . close ( ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (type_identifier) name: (identifier) dimensions: (dimensions))) (throws (type_identifier)) body: (block (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (string_literal))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (identifier) right: (string_literal)))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (type_identifier) arguments: (argument_list (object_creation_expression type: (type_identifier) arguments: (argument_list (object_creation_expression type: (type_identifier) arguments: (argument_list (identifier))))))))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (type_identifier) arguments: (argument_list (object_creation_expression type: (type_identifier) arguments: (argument_list (identifier))))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (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 (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (binary_expression left: (string_literal) right: (identifier)) right: (string_literal))))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) dimensions: (dimensions) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (string_literal))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (array_access array: (identifier) index: (decimal_integer_literal)))))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) dimensions: (dimensions) value: (array_creation_expression type: (type_identifier) 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: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (object_creation_expression type: (type_identifier) arguments: (argument_list (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal)))))))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (null_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: (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (identifier))) condition: (binary_expression left: (update_expression (identifier)) right: (identifier)) body: (block (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (method_invocation object: (array_access array: (identifier) index: (identifier)) name: (identifier) arguments: (argument_list (array_access array: (identifier) index: (identifier)))) name: (identifier) arguments: (argument_list)))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (null_literal))) consequence: (expression_statement (assignment_expression left: (identifier) right: (identifier))) alternative: (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))))))))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (array_access array: (identifier) index: (decimal_integer_literal)) name: (identifier) arguments: (argument_list (identifier))))) (if_statement condition: (parenthesized_expression (unary_expression operand: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (field_access object: (identifier) field: (identifier)))))) consequence: (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))))