public static void main ( String [ ] args ) {
  Scanner sc = new Scanner ( System . in ) ;
  long x = sc . nextLong ( ) ;
  long y = sc . nextLong ( ) ;
  long z = sc . nextLong ( ) ;
  long case1coco1 = x / z ;
  long exc1 = x % z ;
  long case1coco2 = ( y + exc1 ) / z ;
  long diff1 = ( y + exc1 ) % z ;
  if ( diff1 >= exc1 ) {
    exc1 = 0 ;
  }
  else {
    exc1 = exc1 - diff1 ;
  }
  long sum1 = case1coco1 + case1coco2 ;
  long cas2coco2 = y / z ;
  long exc2 = y % z ;
  long case2coco1 = ( x + exc2 ) / z ;
  long diff2 = ( x + exc2 ) % z ;
  if ( diff2 >= exc2 ) {
    exc2 = 0 ;
  }
  else {
    exc2 = exc2 - diff2 ;
  }
  long sum2 = cas2coco2 + case2coco1 ;
  if ( exc1 == 0 || exc2 == 0 ) {
    if ( exc1 == 0 && exc2 != 0 ) {
      System . out . println ( sum1 + " " + exc1 ) ;
    }
    else if ( exc1 != 0 && exc2 == 0 ) {
      System . out . println ( sum2 + " " + exc2 ) ;
    }
    else {
      if ( ( sum1 ) >= ( sum2 ) ) {
        System . out . println ( sum1 + " " + exc1 ) ;
      }
      else {
        System . out . println ( sum2 + " " + exc2 ) ;
      }
    }
  }
  else {
    if ( ( ( sum1 * exc2 ) ) > ( ( sum2 * exc1 ) ) ) {
      System . out . println ( sum1 + " " + exc1 ) ;
    }
    else if ( ( ( sum1 * exc2 ) ) < ( ( sum2 * exc1 ) ) ) {
      System . out . println ( sum2 + " " + exc2 ) ;
    }
    else {
      if ( ( sum1 ) >= ( sum2 ) ) {
        System . out . println ( sum1 + " " + exc1 ) ;
      }
      else {
        System . out . println ( sum2 + " " + exc2 ) ;
      }
    }
  }
}

public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long x = sc . nextLong ( ) ; long y = sc . nextLong ( ) ; long z = sc . nextLong ( ) ; long case1coco1 = x / z ; long exc1 = x % z ; long case1coco2 = ( y + exc1 ) / z ; long diff1 = ( y + exc1 ) % z ; if ( diff1 >= exc1 ) { exc1 = 0 ; } else { exc1 = exc1 - diff1 ; } long sum1 = case1coco1 + case1coco2 ; long cas2coco2 = y / z ; long exc2 = y % z ; long case2coco1 = ( x + exc2 ) / z ; long diff2 = ( x + exc2 ) % z ; if ( diff2 >= exc2 ) { exc2 = 0 ; } else { exc2 = exc2 - diff2 ; } long sum2 = cas2coco2 + case2coco1 ; if ( exc1 == 0 || exc2 == 0 ) { if ( exc1 == 0 && exc2 != 0 ) { System . out . println ( sum1 + " ▁ " + exc1 ) ; } else if ( exc1 != 0 && exc2 == 0 ) { System . out . println ( sum2 + " ▁ " + exc2 ) ; } else { if ( ( sum1 ) >= ( sum2 ) ) { System . out . println ( sum1 + " ▁ " + exc1 ) ; } else { System . out . println ( sum2 + " ▁ " + exc2 ) ; } } } else { if ( ( ( sum1 * exc2 ) ) > ( ( sum2 * exc1 ) ) ) { System . out . println ( sum1 + " ▁ " + exc1 ) ; } else if ( ( ( sum1 * exc2 ) ) < ( ( sum2 * exc1 ) ) ) { System . out . println ( sum2 + " ▁ " + exc2 ) ; } else { if ( ( sum1 ) >= ( sum2 ) ) { System . out . println ( sum1 + " ▁ " + exc1 ) ; } else { System . out . println ( sum2 + " ▁ " + exc2 ) ; } } } }
(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)))) (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: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (identifier) right: (identifier)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (identifier) right: (identifier)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) right: (identifier)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) right: (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal)))) alternative: (block (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (identifier)))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (identifier) right: (identifier)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (identifier) right: (identifier)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (identifier) right: (identifier)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) right: (identifier)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) right: (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal)))) alternative: (block (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (identifier)))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (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: (decimal_integer_literal)))) consequence: (block (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (binary_expression left: (identifier) right: (decimal_integer_literal)))) consequence: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (binary_expression left: (binary_expression left: (identifier) right: (string_literal)) right: (identifier)))))) alternative: (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (binary_expression left: (identifier) right: (decimal_integer_literal)))) consequence: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (binary_expression left: (binary_expression left: (identifier) right: (string_literal)) right: (identifier)))))) alternative: (block (if_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (identifier)) right: (parenthesized_expression (identifier)))) consequence: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (binary_expression left: (binary_expression left: (identifier) right: (string_literal)) right: (identifier)))))) alternative: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (binary_expression left: (binary_expression left: (identifier) right: (string_literal)) right: (identifier))))))))))) alternative: (block (if_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (parenthesized_expression (binary_expression left: (identifier) right: (identifier)))) right: (parenthesized_expression (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 (binary_expression left: (binary_expression left: (identifier) right: (string_literal)) right: (identifier)))))) alternative: (if_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (parenthesized_expression (binary_expression left: (identifier) right: (identifier)))) right: (parenthesized_expression (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 (binary_expression left: (binary_expression left: (identifier) right: (string_literal)) right: (identifier)))))) alternative: (block (if_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (identifier)) right: (parenthesized_expression (identifier)))) consequence: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (binary_expression left: (binary_expression left: (identifier) right: (string_literal)) right: (identifier)))))) alternative: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (binary_expression left: (binary_expression left: (identifier) right: (string_literal)) right: (identifier))))))))))))))