# frozen_string_literal: true A, B, X, N = gets.chomp.split.map(&:to_i) POINTS = [Rational(N, 2).floor, 0].freeze RESULT = X.odd? ? POINTS : POINTS.reverse puts RESULT.join(' ')