



import requests

__snake_case     :List[str]			       ='YOUR API KEY'






def  lowerCamelCase_	(      lowerCAmelCase__	:	str			,	lowerCAmelCase__	:	str = giphy_api_key				)       ->							list:

							'''simple docstring'''






							A      						=    '+'.join(query.split()				)
							A      						=    F'''https://api.giphy.com/v1/gifs/search?q={formatted_query}&api_key={api_key}'''
							A      						=    requests.get(lowerCAmelCase__				).json()['data']
							return [gif["url"] for gif in gifs]


if __name__ == "__main__":
				print('\n'.join(get_gifs('space ship')))




from bisect import bisect
from itertools import accumulate






def  lowerCamelCase_	(      lowerCAmelCase__	:	int			,	lowerCAmelCase__	:	str			,	lowerCAmelCase__	:	List[str]			,	lowerCAmelCase__	:	List[Any]				)       ->							Union[str, Any]:

							'''simple docstring'''






							A      						=    sorted(zip(lowerCAmelCase__			,	lowerCAmelCase__				)			,	key=lambda lowerCAmelCase__				: x[0] / x[1]			,	reverse=lowerCAmelCase__				)
							A						,   A      						=    [i[0] for i in r], [i[1] for i in r]
							A      						=    list(accumulate(lowerCAmelCase__				)				)
							A      						=    bisect(lowerCAmelCase__			,	lowerCAmelCase__				)
							return (
							    0
							    if k == 0
							    else sum(vl[:k]				) + (w - acc[k - 1]) * (vl[k]) / (wt[k])
							    if k != n
							    else sum(vl[:k]				)
							)


if __name__ == "__main__":
				import doctest

				doctest.testmod()