






import math

import tensorflow as tf
from packaging import version




def 					lowercase__				(					__snake_case   :							List[Any]  ):


					'''simple docstring'''


					UpperCAmelCase_   :				List[str]						=						tf.convert_to_tensor(__snake_case  )
					UpperCAmelCase_   :				Optional[int]						=						0.5 * (1.0 + tf.math.erf(x / tf.cast(tf.sqrt(2.0  )					,	x.dtype  )  ))

					return x * cdf




def 					lowercase__				(					__snake_case   :							Union[str, Any]  ):


					'''simple docstring'''


					UpperCAmelCase_   :				List[str]						=						tf.convert_to_tensor(__snake_case  )
					UpperCAmelCase_   :				Tuple						=						tf.cast(math.pi					,	x.dtype  )
					UpperCAmelCase_   :				Tuple						=						tf.cast(0.044715					,	x.dtype  )
					UpperCAmelCase_   :				List[Any]						=						0.5 * (1.0 + tf.tanh(tf.sqrt(2.0 / pi  ) * (x + coeff * tf.pow(__snake_case					,	3  ))  ))

					return x * cdf




def 					lowercase__				(					__snake_case   :							List[str]  ):


					'''simple docstring'''


					UpperCAmelCase_   :				Union[str, Any]						=						tf.convert_to_tensor(__snake_case  )

					return x * tf.tanh(tf.math.softplus(__snake_case  )  )




def 					lowercase__				(					__snake_case   :							Optional[int]  ):


					'''simple docstring'''


					UpperCAmelCase_   :				Optional[int]						=						tf.convert_to_tensor(__snake_case  )
					UpperCAmelCase_   :				List[str]						=						tf.cast(0.044715					,	x.dtype  )
					UpperCAmelCase_   :				List[Any]						=						tf.cast(0.7978845608					,	x.dtype  )

					return 0.5 * x * (1.0 + tf.tanh(x * coeffa * (1.0 + coeffa * x * x)  ))




def 					lowercase__				(					__snake_case   :							str  ):


					'''simple docstring'''


					UpperCAmelCase_   :				List[str]						=						tf.convert_to_tensor(__snake_case  )
					UpperCAmelCase_   :				Tuple						=						tf.cast(1.702					,	x.dtype  )
					return x * tf.math.sigmoid(coeff * x  )




def 					lowercase__				(					__snake_case   :							Dict  ):


					'''simple docstring'''


					return tf.clip_by_value(_gelu(__snake_case  )					,	-10					,	10  )




def 					lowercase__				(					__snake_case   :							int					,	__snake_case   :							Tuple=-1  ):


					'''simple docstring'''


					UpperCAmelCase_	,  UpperCAmelCase_   :				int						=						tf.split(__snake_case					,	2					,	axis=__snake_case  )
					return a * tf.math.sigmoid(__snake_case  )


if version.parse(tf.version.VERSION) >= version.parse('2.4'):




		def 					lowercase__				(					__snake_case   :							str  ):


							'''simple docstring'''


							return tf.keras.activations.gelu(__snake_case					,	approximate=__snake_case  )

		__UpperCAmelCase     							=						tf.keras.activations.gelu






		__UpperCAmelCase     							=						approximate_gelu_wrap
else:
		__UpperCAmelCase     							=						_gelu
		__UpperCAmelCase     							=						_gelu_new


__UpperCAmelCase     							=						{
    'gelu': gelu,
    'gelu_10': gelu_aa,
    'gelu_fast': gelu_fast,
    'gelu_new': gelu_new,
    'glu': glu,
    'mish': mish,
    'quick_gelu': quick_gelu,
    'relu': tf.keras.activations.relu,
    'sigmoid': tf.keras.activations.sigmoid,
    'silu': tf.keras.activations.swish,
    'swish': tf.keras.activations.swish,
    'tanh': tf.keras.activations.tanh,
}






def 					lowercase__				(					__snake_case   :							Union[str, Any]  ):


					'''simple docstring'''


					if activation_string in ACTaFN:
										return ACTaFN[activation_string]
					else:
										raise KeyError(F"function {activation_string} not found in ACT2FN mapping {list(ACTaFN.keys()  )}"  )














from collections import defaultdict
from math import ceil, sqrt




def 					lowercase__				(					__snake_case   :							int = 1_000_000					,	__snake_case   :							int = 10  ):


					'''simple docstring'''


					UpperCAmelCase_   :				defaultdict						=						defaultdict(__snake_case  )

					for outer_width in range(3					,	(t_limit // 4) + 2  ):
										if outer_width * outer_width > t_limit:
															UpperCAmelCase_   :				Union[str, Any]						=						max(
															    ceil(sqrt(outer_width * outer_width - t_limit  )  )					,	1  )
										else:
															UpperCAmelCase_   :				int						=						1

										hole_width_lower_bound += (outer_width - hole_width_lower_bound) % 2

										for hole_width in range(__snake_case					,	outer_width - 1					,	2  ):
															count[outer_width * outer_width - hole_width * hole_width] += 1

					return sum(1 for n in count.values() if 1 <= n <= 10  )


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






