def _next_power_of_2(x):
	"""
	Calculate the closest power of 2, greater than the given x.
	:param x: positive integer
	:return: int - the closest power of 2, greater than the given x.
	"""
	return 1 if x == 0 else 2**(x - 1).bit_length()