



"""simple docstring"""






import argparse
from collections import defaultdict






def 					snake_case__       (		__lowerCamelCase    :   List[Any]							,		__lowerCamelCase    :   List[Any]							,		__lowerCamelCase    :   Dict							,		__lowerCamelCase    :   Optional[int]							,		__lowerCamelCase    :   Any     ):
			"""simple docstring"""
			lowerCamelCase__		:		Union[str, Any]		     =f'''{file}_{class_name}_{test_name}'''
			done_test[_id] += 1

			with open(__lowerCamelCase							,		'''r'''     ) as f:
						lowerCamelCase__		:		Any		     =f.readlines()

			lowerCamelCase__		:		Optional[Any]		     =f'''class {class_name}('''
			lowerCamelCase__		:		List[str]		     =f'''{4 * " "}def {test_name}('''
			lowerCamelCase__		:		Tuple		     =f'''{8 * " "}{correct_line.split()[0]}'''
			lowerCamelCase__		:		List[Any]		     =f'''{16 * " "}{correct_line.split()[0]}'''
			lowerCamelCase__		:		Union[str, Any]		     =False
			lowerCamelCase__		:		Union[str, Any]		     =False
			lowerCamelCase__		:		int		     =False
			lowerCamelCase__		:		Tuple		     =False
			lowerCamelCase__		:		Any		     =0
			lowerCamelCase__		:		Union[str, Any]		     =0

			lowerCamelCase__		:		str		     =[]
			for line in lines:
						if line.startswith(__lowerCamelCase     ):
									lowerCamelCase__		:		Optional[int]		     =True
						elif in_class and line.startswith(__lowerCamelCase     ):
									lowerCamelCase__		:		Any		     =True
						elif in_class and in_func and (line.startswith(__lowerCamelCase     ) or line.startswith(__lowerCamelCase     )):
									lowerCamelCase__		:		Dict		     =len(line.split(correct_line.split()[0]     )[0]     )
									count += 1

									if count == done_test[_id]:
												lowerCamelCase__		:		List[str]		     =True

						if in_class and in_func and in_line:
									if ")" not in line:
												continue
									else:
												lowerCamelCase__		:		Tuple		     =True

						if in_class and in_func and in_line and insert_line:
									new_lines.append(f'''{spaces * " "}{correct_line}'''     )
									lowerCamelCase__		:		Tuple		     =False
						else:
									new_lines.append(__lowerCamelCase     )

			with open(__lowerCamelCase							,		'''w'''     ) as f:
						for line in new_lines:
									f.write(__lowerCamelCase     )






def 					snake_case__       (		__lowerCamelCase    :   Union[str, Any]							,		__lowerCamelCase    :   Union[str, Any]=None     ):
			"""simple docstring"""
			if fail is not None:
						with open(__lowerCamelCase							,		'''r'''     ) as f:
									lowerCamelCase__		:		List[Any]		     ={l.strip() for l in f.readlines()}
			else:
						lowerCamelCase__		:		List[str]		     =None

			with open(__lowerCamelCase							,		'''r'''     ) as f:
						lowerCamelCase__		:		Union[str, Any]		     =f.readlines()

			lowerCamelCase__		:		List[Any]		     =defaultdict(__lowerCamelCase     )
			for line in correct_lines:
						lowerCamelCase__     ,       lowerCamelCase__     ,       lowerCamelCase__     ,       lowerCamelCase__		:		Dict		     =line.split(''';'''     )
						if test_failures is None or "::".join([file, class_name, test_name]     ) in test_failures:
									overwrite_file(__lowerCamelCase							,		__lowerCamelCase							,		__lowerCamelCase							,		__lowerCamelCase							,		__lowerCamelCase     )


if __name__ == "__main__":
		_lowercase			:			Tuple										=						argparse.ArgumentParser()
		parser.add_argument("--correct_filename", help="filename of tests with expected result")
		parser.add_argument("--fail_filename", help="filename of test failures", type=str, default=None)
		_lowercase			:			Optional[Any]										=						parser.parse_args()

		main(args.correct_filename, args.fail_filename)









"""simple docstring"""






from collections import defaultdict

class 	__SCREAMING_SNAKE_CASE     :


					'''simple docstring'''





					def __init__(	self							:  Union[str, Any],  lowerCamelCase							:  List[Any],  lowerCamelCase							:  List[str]					)-> Optional[int]:
								lowerCamelCase__		:		List[Any]		     =total  # total no of tasks (N)

								# DP table will have a dimension of (2^M)*N
								# initially all values are set to -1
								lowerCamelCase__		:		Optional[Any]		     =[
								    [-1 for i in range(total + 1					)] for j in range(2 ** len(lowerCamelCase					)					)
								]

								lowerCamelCase__		:		Any		     =defaultdict(lowerCamelCase					)  # stores the list of persons for each task

								# final_mask is used to check if all persons are included by setting all bits
								# to 1
								lowerCamelCase__		:		List[Any]		     =(1 << len(lowerCamelCase					)) - 1



					def 		snake_case	(	self							:  int,  lowerCamelCase							:  str,  lowerCamelCase							:  Any					)-> Any:
								# if mask == self.finalmask all persons are distributed tasks, return 1
								if mask == self.final_mask:
											return 1

								# if not everyone gets the task and no more tasks are available, return 0
								if task_no > self.total_tasks:
											return 0

								# if case already considered
								if self.dp[mask][task_no] != -1:
											return self.dp[mask][task_no]

								# Number of ways when we don't this task in the arrangement
								lowerCamelCase__		:		Optional[int]		     =self.count_ways_until(lowerCamelCase,  task_no + 1					)

								# now assign the tasks one by one to all possible persons and recursively
								# assign for the remaining tasks.
								if task_no in self.task:
											for p in self.task[task_no]:
														# if p is already given a task
														if mask & (1 << p):
																	continue

														# assign this task to p and change the mask value. And recursively
														# assign tasks with the new mask value.
														total_ways_util += self.count_ways_until(mask | (1 << p),  task_no + 1					)

        # save the value.
								lowerCamelCase__		:		int		     =total_ways_util

								return self.dp[mask][task_no]




					def 		snake_case	(	self							:  Dict,  lowerCamelCase							:  Dict					)-> int:
								# Store the list of persons for each task
								for i in range(len(lowerCamelCase					)					):
											for j in task_performed[i]:
														self.task[j].append(lowerCamelCase					)

        # call the function to fill the DP table, final answer is stored in dp[0][1]
								return self.count_ways_until(0,  1					)


if __name__ == "__main__":
		_lowercase			:			Tuple										=						5  # total no of tasks (the value of N)

		# the list of tasks that can be done by M persons.
		_lowercase			:			Dict										=						[[1, 3, 4], [1, 2, 5], [3, 4]]
		print(
		    AssignmentUsingBitmask(task_performed, total_tasks).count_no_of_ways(
		        task_performed
		    )
		)




