






'''simple docstring'''







import math
import sys





def 			SCREAMING_SNAKE_CASE_	(UpperCamelCase				)				->	str:
							lowerCamelCase__ :     Union[str, Any]	  =	''
							try:
														with open(_UpperCAmelCase    ,      """rb"""				) as binary_file:
																					lowerCamelCase__ :     Dict	  =	binary_file.read()
														for dat in data:
																					lowerCamelCase__ :     Tuple	  =	f'''{dat:08b}'''
																					result += curr_byte
														return result
							except OSError:
														print("""File not accessible"""				)
														sys.exit()





def 			SCREAMING_SNAKE_CASE_	(UpperCamelCase				)				->	str:
							lowerCamelCase__ :     List[Any]	  =	{'0': '0', '1': '1'}
							lowerCamelCase__ :     Tuple	  =	'', ''
							lowerCamelCase__ :     str	  =	len(_UpperCAmelCase				)

							for i in range(len(_UpperCAmelCase				)				):
														curr_string += data_bits[i]
														if curr_string not in lexicon:
																					continue

														lowerCamelCase__ :     Union[str, Any]	  =	lexicon[curr_string]
														result += last_match_id
														lowerCamelCase__ :     List[str]	  =	last_match_id + '0'

														if math.loga(_UpperCAmelCase				).is_integer():
																					lowerCamelCase__ :     Tuple	  =	{}
																					for curr_key in list(_UpperCAmelCase				):
																												lowerCamelCase__ :     Union[str, Any]	  =	lexicon.pop(_UpperCAmelCase				)
																					lowerCamelCase__ :     Tuple	  =	new_lex

														lowerCamelCase__ :     Tuple	  =	last_match_id + '1'
														index += 1
														lowerCamelCase__ :     Any	  =	''
							return result





def 			SCREAMING_SNAKE_CASE_	(UpperCamelCase    ,      UpperCamelCase				)				->	None:
							lowerCamelCase__ :     Union[str, Any]	  =	8
							try:
														with open(_UpperCAmelCase    ,      """wb"""				) as opened_file:
																					lowerCamelCase__ :     Optional[int]	  =	[
																					    to_write[i : i + byte_length]
																					    for i in range(0    ,      len(_UpperCAmelCase				)    ,      _UpperCAmelCase				)
																					]

																					if len(result_byte_array[-1]				) % byte_length == 0:
																												result_byte_array.append("""10000000"""				)
																					else:
																												result_byte_array[-1] += "1" + "0" * (
																												    byte_length - len(result_byte_array[-1]				) - 1
																												)

																					for elem in result_byte_array[:-1]:
																												opened_file.write(int(_UpperCAmelCase    ,      2				).to_bytes(1    ,      byteorder="""big"""				)				)
							except OSError:
														print("""File not accessible"""				)
														sys.exit()





def 			SCREAMING_SNAKE_CASE_	(UpperCamelCase				)				->	str:
							lowerCamelCase__ :     Optional[Any]	  =	0
							for letter in data_bits:
														if letter == "1":
																					break
														counter += 1

							lowerCamelCase__ :     List[Any]	  =	data_bits[counter:]
							lowerCamelCase__ :     Tuple	  =	data_bits[counter + 1 :]
							return data_bits





def 			SCREAMING_SNAKE_CASE_	(UpperCamelCase    ,      UpperCamelCase				)				->	None:
							lowerCamelCase__ :     List[Any]	  =	read_file_binary(_UpperCAmelCase				)
							lowerCamelCase__ :     Optional[Any]	  =	remove_prefix(_UpperCAmelCase				)
							lowerCamelCase__ :     Tuple	  =	decompress_data(_UpperCAmelCase				)
							write_file_binary(_UpperCAmelCase    ,      _UpperCAmelCase				)


if __name__ == "__main__":
			compress(sys.argv[1], sys.argv[2])









'''simple docstring'''







from math import asin, atan, cos, radians, sin, sqrt, tan

_A     :      List[str]   					=637_8137.0
_A     :      Dict   					=635_6752.31_4245
_A     :      int   					=6_378_137





def 			SCREAMING_SNAKE_CASE_	(UpperCamelCase    ,      UpperCamelCase    ,      UpperCamelCase    ,      UpperCamelCase				)				->	float:
							lowerCamelCase__ :     str	  =	(AXIS_A - AXIS_B) / AXIS_A
							lowerCamelCase__ :     Dict	  =	atan((1 - flattening) * tan(radians(UpperCamelCase				)				)				)
							lowerCamelCase__ :     Dict	  =	atan((1 - flattening) * tan(radians(UpperCamelCase				)				)				)
							lowerCamelCase__ :     Optional[Any]	  =	radians(UpperCamelCase				)
							lowerCamelCase__ :     List[Any]	  =	radians(UpperCamelCase				)
							# Equation
							lowerCamelCase__ :     Tuple	  =	sin((phi_a - phi_a) / 2				)
							lowerCamelCase__ :     List[Any]	  =	sin((lambda_a - lambda_a) / 2				)
							# Square both values
							sin_sq_phi *= sin_sq_phi
							sin_sq_lambda *= sin_sq_lambda
							lowerCamelCase__ :     Tuple	  =	sqrt(sin_sq_phi + (cos(UpperCamelCase				) * cos(UpperCamelCase				) * sin_sq_lambda)				)
							return 2 * RADIUS * asin(UpperCamelCase				)


if __name__ == "__main__":
			import doctest

			doctest.testmod()

