
'''simple docstring'''
def      UpperCamelCase_				(      A__						):
	a_      				=						0
	a_      				=						len(A__						)

	for i in range(n - 1						):
		for j in range(i + 1  ,      A__						):
			if arr[i] > arr[j]:
				num_inversions += 1

	return num_inversions






def      UpperCamelCase_				(      A__						):
	if len(A__						) <= 1:
		return arr, 0
	a_      				=						len(A__						) // 2
	a_      				=						arr[0:mid]
	a_      				=						arr[mid:]

	a_				,  a_      				=						count_inversions_recursive(A__						)
	a_				,  a_      				=						count_inversions_recursive(A__						)
	a_				,  a_      				=						_count_cross_inversions(A__  ,      A__						)

	a_      				=						inversion_p + inversions_q + cross_inversions
	return c, num_inversions






def      UpperCamelCase_				(      A__  ,      A__						):
	a_      				=						[]
	a_      				=						a_      				=						a_      				=						0
	while i < len(A__						) and j < len(A__						):
		if p[i] > q[j]:
			# if P[1] > Q[j], then P[k] > Q[k] for all  i < k <= len(P)
			# These are all inversions. The claim emerges from the
			# property that P is sorted.
			num_inversion += len(A__						) - i
			r.append(q[j]						)
			j += 1
		else:
			r.append(p[i]						)
			i += 1

	if i < len(A__						):
		r.extend(p[i:]						)
	else:
		r.extend(q[j:]						)

	return r, num_inversion






def      UpperCamelCase_				(      ):
	a_      				=						[10, 2, 1, 5, 5, 2, 11]

	# this arr has 8 inversions:
	# (10, 2), (10, 1), (10, 5), (10, 5), (10, 2), (2, 1), (5, 2), (5, 2)

	a_      				=						count_inversions_bf(A__						)
	a_				,  a_      				=						count_inversions_recursive(A__						)

	assert num_inversions_bf == num_inversions_recursive == 8

	print("""number of inversions = """  ,      A__						)

	# testing an array with zero inversion (a sorted arr_1)

	arr_a.sort()
	a_      				=						count_inversions_bf(A__						)
	a_				,  a_      				=						count_inversions_recursive(A__						)

	assert num_inversions_bf == num_inversions_recursive == 0
	print("""number of inversions = """  ,      A__						)

	# an empty list should also have zero inversions
	a_      				=						[]
	a_      				=						count_inversions_bf(A__						)
	a_				,  a_      				=						count_inversions_recursive(A__						)

	assert num_inversions_bf == num_inversions_recursive == 0
	print("""number of inversions = """  ,      A__						)


if __name__ == "__main__":
		main()


'''simple docstring'''
import math






def      UpperCamelCase_				(      A__ = 1_00						):
	a_      				=						sum(i * i for i in range(1  ,      n + 1						)						)
	a_      				=						int(math.pow(sum(range(1  ,      n + 1						)						)  ,      2						)						)
	return square_of_sum - sum_of_squares


if __name__ == "__main__":
		print(F"""{solution() = }""")
