





import gc
import unittest

from diffusers import FlaxDPMSolverMultistepScheduler, FlaxStableDiffusionPipeline
from diffusers.utils import is_flax_available, slow
from diffusers.utils.testing_utils import require_flax


if is_flax_available():
					import jax
					import jax.numpy as jnp
					from flax.jax_utils import replicate
					from flax.training.common_utils import shard
@slow
@require_flax
class      UpperCamelCase_						(					unittest.TestCase   ):




					def 		lowerCAmelCase     (						self					)						->							Optional[Any]:
										# clean up the VRAM after each test
										super().tearDown()
										gc.collect()




					def 		lowerCAmelCase     (						self					)						->							Optional[int]:
										_snake_case							,       _snake_case													=			FlaxStableDiffusionPipeline.from_pretrained(
										    'stabilityai/stable-diffusion-2'			,  revision='bf16'			,  dtype=jnp.bfloataa			,  )

										_snake_case													=			'A painting of a squirrel eating a burger'
										_snake_case													=			jax.device_count()
										_snake_case													=			num_samples * [prompt]
										_snake_case													=			sd_pipe.prepare_inputs(lowerCAmelCase_					)

										_snake_case													=			replicate(lowerCAmelCase_					)
										_snake_case													=			shard(lowerCAmelCase_					)

										_snake_case													=			jax.random.PRNGKey(0					)
										_snake_case													=			jax.random.split(lowerCAmelCase_			,  jax.device_count()					)

										_snake_case													=			sd_pipe(lowerCAmelCase_			,  lowerCAmelCase_			,  lowerCAmelCase_			,  num_inference_steps=25			,  jit=lowerCAmelCase_					)[0]
										assert images.shape == (jax.device_count(), 1, 768, 768, 3)

										_snake_case													=			images.reshape((images.shape[0] * images.shape[1],) + images.shape[-3:]					)
										_snake_case													=			images[0, 253:256, 253:256, -1]

										_snake_case													=			jnp.asarray(jax.device_get(image_slice.flatten()					)					)
										_snake_case													=			jnp.array([0.42_38, 0.44_14, 0.43_95, 0.44_53, 0.46_29, 0.45_90, 0.45_31, 0.4_55_08, 0.45_12]					)
										print(F'''output_slice: {output_slice}'''					)
										assert jnp.abs(output_slice - expected_slice					).max() < 1E-2






					def 		lowerCAmelCase     (						self					)						->							List[Any]:
										_snake_case													=			'stabilityai/stable-diffusion-2'
										_snake_case							,       _snake_case													=			FlaxDPMSolverMultistepScheduler.from_pretrained(lowerCAmelCase_			,  subfolder='scheduler'					)
										_snake_case							,       _snake_case													=			FlaxStableDiffusionPipeline.from_pretrained(
										    lowerCAmelCase_			,  scheduler=lowerCAmelCase_			,  revision='bf16'			,  dtype=jnp.bfloataa			,  )
										_snake_case													=			scheduler_params

										_snake_case													=			'A painting of a squirrel eating a burger'
										_snake_case													=			jax.device_count()
										_snake_case													=			num_samples * [prompt]
										_snake_case													=			sd_pipe.prepare_inputs(lowerCAmelCase_					)

										_snake_case													=			replicate(lowerCAmelCase_					)
										_snake_case													=			shard(lowerCAmelCase_					)

										_snake_case													=			jax.random.PRNGKey(0					)
										_snake_case													=			jax.random.split(lowerCAmelCase_			,  jax.device_count()					)

										_snake_case													=			sd_pipe(lowerCAmelCase_			,  lowerCAmelCase_			,  lowerCAmelCase_			,  num_inference_steps=25			,  jit=lowerCAmelCase_					)[0]
										assert images.shape == (jax.device_count(), 1, 768, 768, 3)

										_snake_case													=			images.reshape((images.shape[0] * images.shape[1],) + images.shape[-3:]					)
										_snake_case													=			images[0, 253:256, 253:256, -1]

										_snake_case													=			jnp.asarray(jax.device_get(image_slice.flatten()					)					)
										_snake_case													=			jnp.array([0.43_36, 0.4_29_69, 0.44_53, 0.41_99, 0.42_97, 0.45_31, 0.44_34, 0.44_34, 0.42_97]					)
										print(F'''output_slice: {output_slice}'''					)
										assert jnp.abs(output_slice - expected_slice					).max() < 1E-2










def   lowerCamelCase__       (       )     ->	int:



					'''simple docstring'''




					return 1





def   lowerCamelCase__       (       UpperCamelCase__     :    int  )     ->	int:



					'''simple docstring'''




					return 0 if x < 0 else two_pence(x - 2  ) + one_pence()





def   lowerCamelCase__       (       UpperCamelCase__     :    int  )     ->	int:



					'''simple docstring'''




					return 0 if x < 0 else five_pence(x - 5  ) + two_pence(UpperCamelCase__  )





def   lowerCamelCase__       (       UpperCamelCase__     :    int  )     ->	int:



					'''simple docstring'''




					return 0 if x < 0 else ten_pence(x - 10  ) + five_pence(UpperCamelCase__  )





def   lowerCamelCase__       (       UpperCamelCase__     :    int  )     ->	int:



					'''simple docstring'''




					return 0 if x < 0 else twenty_pence(x - 20  ) + ten_pence(UpperCamelCase__  )





def   lowerCamelCase__       (       UpperCamelCase__     :    int  )     ->	int:



					'''simple docstring'''




					return 0 if x < 0 else fifty_pence(x - 50  ) + twenty_pence(UpperCamelCase__  )





def   lowerCamelCase__       (       UpperCamelCase__     :    int  )     ->	int:



					'''simple docstring'''




					return 0 if x < 0 else one_pound(x - 100  ) + fifty_pence(UpperCamelCase__  )





def   lowerCamelCase__       (       UpperCamelCase__     :    int  )     ->	int:



					'''simple docstring'''




					return 0 if x < 0 else two_pound(x - 200  ) + one_pound(UpperCamelCase__  )





def   lowerCamelCase__       (       UpperCamelCase__     :    int = 200  )     ->	int:



					'''simple docstring'''




					return two_pound(UpperCamelCase__  )


if __name__ == "__main__":
					print(solution(int(input().strip())))



