

def   __SCREAMING_SNAKE_CASE					(SCREAMING_SNAKE_CASE__       ):
						snake_case_   =	generate_pascal_triangle(SCREAMING_SNAKE_CASE__       )
						for row_idx in range(SCREAMING_SNAKE_CASE__       ):
												# Print left spaces
												for _ in range(num_rows - row_idx - 1       ):
																		print(end=''' '''       )
												# Print row values
												for col_idx in range(row_idx + 1       ):
																		if col_idx != row_idx:
																								print(triangle[row_idx][col_idx]  ,		end=''' '''       )
																		else:
																								print(triangle[row_idx][col_idx]  ,		end=''''''       )
												print()


def   __SCREAMING_SNAKE_CASE					(SCREAMING_SNAKE_CASE__       ):

						if not isinstance(SCREAMING_SNAKE_CASE__  ,		SCREAMING_SNAKE_CASE__       ):
												raise TypeError('''The input value of \'num_rows\' should be \'int\''''       )

						if num_rows == 0:
												return []
						elif num_rows < 0:
												raise ValueError(
												    '''The input value of \'num_rows\' should be greater than or equal to 0'''       )

						snake_case_   =	[]
						for current_row_idx in range(SCREAMING_SNAKE_CASE__       ):
												snake_case_   =	populate_current_row(SCREAMING_SNAKE_CASE__  ,		SCREAMING_SNAKE_CASE__       )
												triangle.append(SCREAMING_SNAKE_CASE__       )
						return triangle


def   __SCREAMING_SNAKE_CASE					(SCREAMING_SNAKE_CASE__  ,		SCREAMING_SNAKE_CASE__       ):
						snake_case_   =	[-1] * (current_row_idx + 1)
						# first and last elements of current row are equal to 1
						snake_case_,    snake_case_   =	1, 1
						for current_col_idx in range(1  ,		SCREAMING_SNAKE_CASE__       ):
												calculate_current_element(
												    SCREAMING_SNAKE_CASE__  ,		SCREAMING_SNAKE_CASE__  ,		SCREAMING_SNAKE_CASE__  ,		SCREAMING_SNAKE_CASE__       )
						return current_row


def   __SCREAMING_SNAKE_CASE					(SCREAMING_SNAKE_CASE__  ,		SCREAMING_SNAKE_CASE__  ,		SCREAMING_SNAKE_CASE__  ,		SCREAMING_SNAKE_CASE__  ,		):
						snake_case_   =	triangle[current_row_idx - 1][current_col_idx - 1]
						snake_case_   =	triangle[current_row_idx - 1][current_col_idx]
						snake_case_   =	above_to_left_elt + above_to_right_elt


def   __SCREAMING_SNAKE_CASE					(SCREAMING_SNAKE_CASE__       ):

						if not isinstance(SCREAMING_SNAKE_CASE__  ,		SCREAMING_SNAKE_CASE__       ):
												raise TypeError('''The input value of \'num_rows\' should be \'int\''''       )

						if num_rows == 0:
												return []
						elif num_rows < 0:
												raise ValueError(
												    '''The input value of \'num_rows\' should be greater than or equal to 0'''       )

						snake_case_   =	[[1]]

						for row_index in range(1  ,		SCREAMING_SNAKE_CASE__       ):
												snake_case_   =	[0] + result[-1] + [0]
												snake_case_   =	row_index + 1
												# Calculate the number of distinct elements in a row
												snake_case_   =	sum(divmod(SCREAMING_SNAKE_CASE__  ,		2       )       )
												snake_case_   =	[
												    temp_row[i - 1] + temp_row[i] for i in range(1  ,		distinct_elements + 1       )
												]
												snake_case_   =	row_first_half[: (row_index + 1) // 2]
												row_second_half.reverse()
												snake_case_   =	row_first_half + row_second_half
												result.append(SCREAMING_SNAKE_CASE__       )

						return result


def   __SCREAMING_SNAKE_CASE					():
						from collections.abc import Callable
						from timeit import timeit

						def benchmark_a_function(SCREAMING_SNAKE_CASE__  ,		SCREAMING_SNAKE_CASE__       ) -> None:
												snake_case_   =	F'''{func.__name__}({value})'''
												snake_case_   =	timeit(F'''__main__.{call}'''  ,		setup='''import __main__'''       )
												# print(f"{call:38} = {func(value)} -- {timing:.4f} seconds")
												print(F'''{call:38} -- {timing:.4f} seconds'''       )

						for value in range(15       ):  # (1, 7, 14):
												for func in (generate_pascal_triangle, generate_pascal_triangle_optimized):
																		benchmark_a_function(SCREAMING_SNAKE_CASE__  ,		SCREAMING_SNAKE_CASE__       )
												print()


if __name__ == "__main__":
					import doctest

					doctest.testmod()
					benchmark()


import math


def   __SCREAMING_SNAKE_CASE					(SCREAMING_SNAKE_CASE__       ):

						if 1 < number < 4:
												# 2 and 3 are primes
												return True
						elif number < 2 or number % 2 == 0 or number % 3 == 0:
												# Negatives, 0, 1, all even numbers, all multiples of 3 are not primes
												return False

						# All primes number are in format of 6k +/- 1
						for i in range(5  ,		int(math.sqrt(SCREAMING_SNAKE_CASE__       ) + 1       )  ,		6       ):
												if number % i == 0 or number % (i + 2) == 0:
																		return False
						return True


def   __SCREAMING_SNAKE_CASE					(SCREAMING_SNAKE_CASE__ = 10001       ):

						try:
												snake_case_   =	int(SCREAMING_SNAKE_CASE__       )
						except (TypeError, ValueError):
												raise TypeError('''Parameter nth must be int or castable to int.'''       ) from None
						if nth <= 0:
												raise ValueError('''Parameter nth must be greater than or equal to one.'''       )
						snake_case_   =	[]
						snake_case_   =	2
						while len(SCREAMING_SNAKE_CASE__       ) < nth:
												if is_prime(SCREAMING_SNAKE_CASE__       ):
																		primes.append(SCREAMING_SNAKE_CASE__       )
																		num += 1
												else:
																		num += 1
						return primes[len(SCREAMING_SNAKE_CASE__       ) - 1]


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