import math


def calculate_number_of_combinations(n: int, r:int = 2) -> int:
	""" Calculates the number of pairwise combinations for an iterable of size `elements` using the
		formula `n!/((n-r)!r!)
		Since we only want combinations of pairs (`r` = 2), this can be simplified to
		`n * (n-1).
	"""
	n_factorial = math.factorial(n)
	r_factorial = math.factorial(r)
	n_minus_r_factorial = math.factorial(n-r)
	#return int(n * (n - r)/r)

	result = n_factorial / (n_minus_r_factorial * r_factorial)
	return int(result)