



"""simple docstring"""







from __future__ import annotations

import pandas as pd



def      __UpperCAmelCase      (    __lowerCamelCase						,     __lowerCamelCase						,     __lowerCamelCase	)							->      list[int]:
		lowercase__   :    Union[str, Any]				=			[0] * no_of_processes
		lowercase__   :    Dict				=			[0] * no_of_processes
		# Copy the burst time into remaining_time[]
		for i in range(__lowerCamelCase	):
				lowercase__   :    int				=			burst_time[i]

		lowercase__   :    Dict				=			0
		lowercase__   :    Optional[int]				=			0
		lowercase__   :    Tuple				=			9_99_99_99_99
		lowercase__   :    List[str]				=			0
		lowercase__   :    List[str]				=			False

		# Process until all processes are completed
		while complete != no_of_processes:
				for j in range(__lowerCamelCase	):
						if arrival_time[j] <= increment_time and remaining_time[j] > 0:
								if remaining_time[j] < minm:
										lowercase__   :    Tuple				=			remaining_time[j]
										lowercase__   :    List[Any]				=			j
										lowercase__   :    Optional[int]				=			True

				if not check:
						increment_time += 1
						continue
				remaining_time[short] -= 1

				lowercase__   :    int				=			remaining_time[short]
				if minm == 0:
						lowercase__   :    List[Any]				=			9_99_99_99_99

				if remaining_time[short] == 0:
						complete += 1
						lowercase__   :    List[Any]				=			False

						# Find finish time of current process
						lowercase__   :    str				=			increment_time + 1

						# Calculate waiting time
						lowercase__   :    Optional[Any]				=			finish_time - arrival_time[short]
						lowercase__   :    Dict				=			finar - burst_time[short]

						if waiting_time[short] < 0:
								lowercase__   :    List[str]				=			0

        # Increment time
				increment_time += 1
		return waiting_time



def      __UpperCAmelCase      (    __lowerCamelCase						,     __lowerCamelCase						,     __lowerCamelCase	)							->      list[int]:
		lowercase__   :    Optional[int]				=			[0] * no_of_processes
		for i in range(__lowerCamelCase	):
				lowercase__   :    int				=			burst_time[i] + waiting_time[i]
		return turn_around_time



def      __UpperCAmelCase      (    __lowerCamelCase						,     __lowerCamelCase						,     __lowerCamelCase	)							->      None:
		lowercase__   :    Union[str, Any]				=			0
		lowercase__   :    Tuple				=			0
		for i in range(__lowerCamelCase	):
				lowercase__   :    Optional[int]				=			total_waiting_time + waiting_time[i]
				lowercase__   :    Tuple				=			total_turn_around_time + turn_around_time[i]
		print(f"""Average waiting time = {total_waiting_time / no_of_processes:.5f}"""	)
		print('''Average turn around time ='''						,     total_turn_around_time / no_of_processes	)


if __name__ == "__main__":
							print('Enter how many process you want to analyze')
							lowerCAmelCase_   						=   int(input())
							lowerCAmelCase_   						=   [0] * no_of_processes
							lowerCAmelCase_   						=   [0] * no_of_processes
							lowerCAmelCase_   						=   list(range(1, no_of_processes + 1))

							for i in range(no_of_processes):
														print('Enter the arrival time and burst time for process:--' + str(i + 1))
														lowerCAmelCase_						,lowerCAmelCase_   						=   map(int, input().split())

							lowerCAmelCase_   						=   calculate_waitingtime(arrival_time, burst_time, no_of_processes)

							lowerCAmelCase_   						=   burst_time
							lowerCAmelCase_   						=   no_of_processes
							lowerCAmelCase_   						=   waiting_time
							lowerCAmelCase_   						=   calculate_turnaroundtime(bt, n, wt)

							calculate_average_times(waiting_time, turn_around_time, no_of_processes)

							lowerCAmelCase_   						=   pd.DataFrame(
							    list(zip(processes, burst_time, arrival_time, waiting_time, turn_around_time)),
							    columns=[
							        'Process',
							        'BurstTime',
							        'ArrivalTime',
							        'WaitingTime',
							        'TurnAroundTime',
							    ],
							)

							# Printing the dataFrame
							pd.set_option('display.max_rows', fcfs.shape[0] + 1)
							print(fcfs)





"""simple docstring"""







def      __UpperCAmelCase      (    __lowerCamelCase = 50	)							->      int:
		lowercase__   :    int				=			[[0] * 3 for _ in range(length + 1	)]

		for row_length in range(length + 1	):
				for tile_length in range(2						,     5	):
						for tile_start in range(row_length - tile_length + 1	):
								different_colour_ways_number[row_length][tile_length - 2] += (
								    different_colour_ways_number[row_length - tile_start - tile_length][
								        tile_length - 2
								    ]
								    + 1
								)

		return sum(different_colour_ways_number[length]	)


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