

def       lowercase					(	__A :					int		)				->			"list[int]":





    '''simple docstring'''




    if upper_limit < 0:
        raise ValueError("""Limit for the Catalan sequence must be ≥ 0"""		)

    snake_case							:		Dict        =		[0] * (upper_limit + 1)

    # Base case: C(0) = C(1) = 1
    snake_case							:		Dict        =		1
    if upper_limit > 0:
        snake_case							:		Optional[Any]        =		1

    # Recurrence relation: C(i) = sum(C(j).C(i-j-1)), from j = 0 to i
    for i in range(2 ,    upper_limit + 1		):
        for j in range(__A		):
            catalan_list[i] += catalan_list[j] * catalan_list[i - j - 1]

    return catalan_list


if __name__ == "__main__":
     print('''\n********* Catalan Numbers Using Dynamic Programming ************\n''')
     print('''\n*** Enter -1 at any time to quit ***''')
     print('''\nEnter the upper limit (≥ 0) for the Catalan number sequence: ''', end='''''')
     try:
          while True:
               __lowercase     : Union[str, Any]       =						int(input().strip())
               if N < 0:
                    print('''\n********* Goodbye!! ************''')
                    break
               else:
                    print(f'''The Catalan numbers from 0 through {N} are:''')
                    print(catalan_numbers(N))
                    print('''Try another upper limit for the sequence: ''', end='''''')
     except (NameError, ValueError):
          print('''\n********* Invalid input, goodbye! ************\n''')

     import doctest

     doctest.testmod()








from datetime import datetime

import requests

def        __a			(   __lowerCAmelCase   )     ->     bytes:
					SCREAMING_SNAKE_CASE							:     int						=				'https://downloadgram.net/wp-json/wppress/video-downloader/video?url='
					SCREAMING_SNAKE_CASE							:     Any						=				requests.get(base_url + url   ).json()[0]['urls'][0]['src']
					return requests.get(__lowerCAmelCase   ).content


if __name__ == "__main__":
			_lowerCamelCase    :		List[Any]		      =    input("""Enter Video/IGTV url: """).strip()
			_lowerCamelCase    :		int		      =    f"""{datetime.now():%Y-%m-%d_%H:%M:%S}.mp4"""
			with open(file_name, """wb""") as fp:
						fp.write(download_video(url))
			print(f"""Done. Video saved to disk as {file_name}.""")