
"""simple docstring"""




def lowercase_						(     _snake_case     ,_snake_case		):

							if not len(UpperCAmelCase__		) == len(UpperCAmelCase__		) == 3:
														raise ValueError("""Please enter a valid equation."""		)
							if equationa[0] == equationa[1] == equationa[0] == equationa[1] == 0:
														raise ValueError("""Both a & b of two equations can't be zero."""		)

							# Extract the coefficients
							SCREAMING_SNAKE_CASE__   ,   SCREAMING_SNAKE_CASE__   ,   SCREAMING_SNAKE_CASE__		: Tuple     =     equationa
							SCREAMING_SNAKE_CASE__   ,   SCREAMING_SNAKE_CASE__   ,   SCREAMING_SNAKE_CASE__		: Union[str, Any]     =     equationa

							# Calculate the determinants of the matrices
							SCREAMING_SNAKE_CASE__		: List[str]     =     aa * ba - aa * ba
							SCREAMING_SNAKE_CASE__		: Optional[int]     =     ca * ba - ca * ba
							SCREAMING_SNAKE_CASE__		: List[Any]     =     aa * ca - aa * ca

							# Check if the system of linear equations has a solution (using Cramer's rule)
							if determinant == 0:
														if determinant_x == determinant_y == 0:
																					raise ValueError("""Infinite solutions. (Consistent system)"""		)
														else:
																					raise ValueError("""No solution. (Inconsistent system)"""		)
							else:
														if determinant_x == determinant_y == 0:
																					# Trivial solution (Inconsistent system)
																					return (0.0, 0.0)
														else:
																					SCREAMING_SNAKE_CASE__		: List[str]     =     determinant_x / determinant
																					SCREAMING_SNAKE_CASE__		: Optional[Any]     =     determinant_y / determinant
																					# Non-Trivial Solution (Consistent system)
																					return (x, y)





"""simple docstring"""




import torch

def lowercase_						(     ):
							if torch.cuda.is_available():
														SCREAMING_SNAKE_CASE__		: List[Any]     =     torch.cuda.device_count()
							else:
														SCREAMING_SNAKE_CASE__		: int     =     0
							print(f'''Successfully ran on {num_gpus} GPUs'''		)


if __name__ == "__main__":
					main()




