




"""simple docstring"""





import unittest

import numpy as np

from transformers.testing_utils import require_torch, require_vision
from transformers.utils import is_torch_available, is_vision_available

from ...test_image_processing_common import ImageProcessingSavingTestMixin


if is_torch_available():
							import torch

if is_vision_available():
							from PIL import Image

							from transformers import TvltImageProcessor

def 		lowerCAmelCase				(			lowerCamelCase   ,      lowerCamelCase=10   ,      lowerCamelCase=10   ,      lowerCamelCase=False   ,      lowerCamelCase=False		):
						'''simple docstring'''


						snake_case__							:       Optional[Any]				      =       []
						for i in range(image_processor_tester.num_frames		):
												video.append(np.random.randint(255   ,      size=(image_processor_tester.num_channels, width, height)   ,      dtype=np.uinta		)		)

						if not numpify and not torchify:
												# PIL expects the channel dimension as last dimension
												snake_case__							:       Optional[Any]				      =       [Image.fromarray(np.moveaxis(UpperCAmelCase_   ,      0   ,      -1		)		) for frame in video]

						if torchify:
												snake_case__							:       List[str]				      =       [torch.from_numpy(UpperCAmelCase_		) for frame in video]

						return video

def 		lowerCAmelCase				(			lowerCamelCase   ,      lowerCamelCase=False   ,      lowerCamelCase=False   ,      lowerCamelCase=False		):
						'''simple docstring'''


						assert not (numpify and torchify), "You cannot specify both numpy and PyTorch tensors at the same time"

						snake_case__							:       str				      =       []
						for i in range(image_processor_tester.batch_size		):
												if equal_resolution:
																		snake_case__							:       Tuple				      =       image_processor_tester.max_resolution
												else:
																		snake_case__							:       Optional[int]				      =       np.random.choice(
																		    np.arange(image_processor_tester.min_resolution   ,      image_processor_tester.max_resolution		)   ,      2		)
																		snake_case__							:       Dict				      =       prepare_video(
																		    image_processor_tester=UpperCAmelCase_   ,      width=UpperCAmelCase_   ,      height=UpperCAmelCase_   ,      numpify=UpperCAmelCase_   ,      torchify=UpperCAmelCase_   ,      )
												video_inputs.append(UpperCAmelCase_		)

						return video_inputs

class    __lowercase							(      unittest.TestCase						):


				'''simple docstring'''


				def __init__( self :  Tuple   ,SCREAMING_SNAKE_CASE_ :  List[Any]   ,SCREAMING_SNAKE_CASE_ :  str=7   ,SCREAMING_SNAKE_CASE_ :  List[str]=3   ,SCREAMING_SNAKE_CASE_ :  Dict=4   ,SCREAMING_SNAKE_CASE_ :  Dict=1_8   ,SCREAMING_SNAKE_CASE_ :  int=3_0   ,SCREAMING_SNAKE_CASE_ :  Tuple=4_0_0   ,SCREAMING_SNAKE_CASE_ :  Dict=True   ,SCREAMING_SNAKE_CASE_ :  Union[str, Any]=None   ,SCREAMING_SNAKE_CASE_ :  int=True   ,SCREAMING_SNAKE_CASE_ :  Tuple=[0.5, 0.5, 0.5]   ,SCREAMING_SNAKE_CASE_ :  int=[0.5, 0.5, 0.5]   ,SCREAMING_SNAKE_CASE_ :  str=True   ,SCREAMING_SNAKE_CASE_ :  int=None   ,):
										snake_case__							:       Tuple				      =       size if size is not None else {'shortest_edge': 1_8}
										snake_case__							:       List[str]				      =       crop_size if crop_size is not None else {'height': 1_8, 'width': 1_8}

										snake_case__							:       Optional[Any]				      =       parent
										snake_case__							:       List[str]				      =       batch_size
										snake_case__							:       int				      =       num_channels
										snake_case__							:       Dict				      =       num_frames
										snake_case__							:       Tuple				      =       image_size
										snake_case__							:       str				      =       min_resolution
										snake_case__							:       Dict				      =       max_resolution
										snake_case__							:       Optional[Any]				      =       do_resize
										snake_case__							:       Optional[int]				      =       size
										snake_case__							:       Dict				      =       do_normalize
										snake_case__							:       Optional[int]				      =       image_mean
										snake_case__							:       List[str]				      =       image_std
										snake_case__							:       List[str]				      =       do_center_crop
										snake_case__							:       Optional[int]				      =       crop_size





				def    _lowerCamelCase       ( self :  Union[str, Any]   ):
										return {
										    "image_mean": self.image_mean,
										    "image_std": self.image_std,
										    "do_normalize": self.do_normalize,
										    "do_resize": self.do_resize,
										    "size": self.size,
										    "do_center_crop": self.do_center_crop,
										    "crop_size": self.crop_size,
										}







@require_torch
@require_vision
class    __lowercase							(      _snake_case    , unittest.TestCase						):


				'''simple docstring'''


				_lowerCAmelCase						      =TvltImageProcessor if is_vision_available() else None

				def    _lowerCamelCase       ( self :  Dict   ):
										snake_case__							:       Dict				      =       TvltImageProcessorTester(self   )

				@property
				def    _lowerCamelCase       ( self :  str   ):
										return self.image_processor_tester.prepare_image_processor_dict()

				def    _lowerCamelCase       ( self :  Any   ):
										snake_case__							:       Tuple				      =       self.image_processing_class(**self.image_processor_dict   )
										self.assertTrue(hasattr(lowercase_   ,'''image_mean'''   )   )
										self.assertTrue(hasattr(lowercase_   ,'''image_std'''   )   )
										self.assertTrue(hasattr(lowercase_   ,'''do_normalize'''   )   )
										self.assertTrue(hasattr(lowercase_   ,'''do_resize'''   )   )
										self.assertTrue(hasattr(lowercase_   ,'''do_center_crop'''   )   )
										self.assertTrue(hasattr(lowercase_   ,'''size'''   )   )

				def    _lowerCamelCase       ( self :  Union[str, Any]   ):
										# Initialize image_processor
										snake_case__							:       Tuple				      =       self.image_processing_class(**self.image_processor_dict   )
										# create random PIL videos
										snake_case__							:       Any				      =       prepare_video_inputs(self.image_processor_tester   ,equal_resolution=lowercase_   )
										for video in video_inputs:
																self.assertIsInstance(lowercase_   ,lowercase_   )
																self.assertIsInstance(video[0]   ,Image.Image   )

										# Test not batched input
										snake_case__							:       Optional[int]				      =       image_processor(video_inputs[0]   ,return_tensors='''pt'''   ).pixel_values
										self.assertEqual(
										    encoded_videos.shape   ,(
										        1,
										        self.image_processor_tester.num_frames,
										        self.image_processor_tester.num_channels,
										        self.image_processor_tester.crop_size['''height'''],
										        self.image_processor_tester.crop_size['''width'''],
										    )   ,)

										# Test batched
										snake_case__							:       Union[str, Any]				      =       image_processor(lowercase_   ,return_tensors='''pt'''   ).pixel_values
										self.assertEqual(
										    encoded_videos.shape   ,(
										        self.image_processor_tester.batch_size,
										        self.image_processor_tester.num_frames,
										        self.image_processor_tester.num_channels,
										        self.image_processor_tester.crop_size['''height'''],
										        self.image_processor_tester.crop_size['''width'''],
										    )   ,)

				def    _lowerCamelCase       ( self :  Any   ):
										# Initialize image_processor
										snake_case__							:       Dict				      =       self.image_processing_class(**self.image_processor_dict   )
										# create random numpy tensors
										snake_case__							:       Tuple				      =       prepare_video_inputs(self.image_processor_tester   ,equal_resolution=lowercase_   ,numpify=lowercase_   )
										for video in video_inputs:
																self.assertIsInstance(lowercase_   ,lowercase_   )
																self.assertIsInstance(video[0]   ,np.ndarray   )

										# Test not batched input
										snake_case__							:       Dict				      =       image_processor(video_inputs[0]   ,return_tensors='''pt'''   ).pixel_values
										self.assertEqual(
										    encoded_videos.shape   ,(
										        1,
										        self.image_processor_tester.num_frames,
										        self.image_processor_tester.num_channels,
										        self.image_processor_tester.crop_size['''height'''],
										        self.image_processor_tester.crop_size['''width'''],
										    )   ,)

										# Test batched
										snake_case__							:       Dict				      =       image_processor(lowercase_   ,return_tensors='''pt'''   ).pixel_values
										self.assertEqual(
										    encoded_videos.shape   ,(
										        self.image_processor_tester.batch_size,
										        self.image_processor_tester.num_frames,
										        self.image_processor_tester.num_channels,
										        self.image_processor_tester.crop_size['''height'''],
										        self.image_processor_tester.crop_size['''width'''],
										    )   ,)





				def    _lowerCamelCase       ( self :  Optional[Any]   ):
										# Initialize image_processor
										snake_case__							:       Optional[int]				      =       self.image_processing_class(**self.image_processor_dict   )
										# create random PyTorch tensors
										snake_case__							:       int				      =       prepare_video_inputs(self.image_processor_tester   ,equal_resolution=lowercase_   ,torchify=lowercase_   )
										for video in video_inputs:
																self.assertIsInstance(lowercase_   ,lowercase_   )
																self.assertIsInstance(video[0]   ,torch.Tensor   )

										# Test not batched input
										snake_case__							:       List[str]				      =       image_processor(video_inputs[0]   ,return_tensors='''pt'''   ).pixel_values
										self.assertEqual(
										    encoded_videos.shape   ,(
										        1,
										        self.image_processor_tester.num_frames,
										        self.image_processor_tester.num_channels,
										        self.image_processor_tester.crop_size['''height'''],
										        self.image_processor_tester.crop_size['''width'''],
										    )   ,)

										# Test batched
										snake_case__							:       List[str]				      =       image_processor(lowercase_   ,return_tensors='''pt'''   ).pixel_values
										self.assertEqual(
										    encoded_videos.shape   ,(
										        self.image_processor_tester.batch_size,
										        self.image_processor_tester.num_frames,
										        self.image_processor_tester.num_channels,
										        self.image_processor_tester.crop_size['''height'''],
										        self.image_processor_tester.crop_size['''width'''],
										    )   ,)





'''simple docstring'''

def  UpperCamelCase(	UpperCAmelCase_ = 1_00      ):
 UpperCAmelCase			:      Optional[Any]		   =					[[0 for _ in range(UpperCAmelCase_      )] for _ in range(m + 1      )]
 for i in range(m + 1      ):
  UpperCAmelCase			:      Optional[int]		   =					1

 for n in range(m + 1      ):
  for k in range(1    ,			UpperCAmelCase_      ):
   memo[n][k] += memo[n][k - 1]
   if n > k:
    memo[n][k] += memo[n - k - 1][k]

 return memo[m][m - 1] - 1


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




