



from bisect import bisect
from itertools import accumulate







def snake_case__  (			__SCREAMING_SNAKE_CASE			,     __SCREAMING_SNAKE_CASE			,     __SCREAMING_SNAKE_CASE			,     __SCREAMING_SNAKE_CASE )		->							Optional[Any]:
		UpperCAmelCase_						=				sorted(zip(__SCREAMING_SNAKE_CASE			,     __SCREAMING_SNAKE_CASE )			,     key=lambda __SCREAMING_SNAKE_CASE : x[0] / x[1]			,     reverse=__SCREAMING_SNAKE_CASE )
		UpperCAmelCase_					,						UpperCAmelCase_						=				[i[0] for i in r], [i[1] for i in r]
		UpperCAmelCase_						=				list(accumulate(__SCREAMING_SNAKE_CASE ) )
		UpperCAmelCase_						=				bisect(__SCREAMING_SNAKE_CASE			,     __SCREAMING_SNAKE_CASE )
		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()






def snake_case__  (			__SCREAMING_SNAKE_CASE )		->							int:
		UpperCAmelCase_						=				[1]

		UpperCAmelCase_					,						UpperCAmelCase_					,						UpperCAmelCase_						=				0, 0, 0
		UpperCAmelCase_						=				ugly_nums[ia] * 2
		UpperCAmelCase_						=				ugly_nums[ia] * 3
		UpperCAmelCase_						=				ugly_nums[ia] * 5

		for _ in range(1			,     __SCREAMING_SNAKE_CASE ):
				UpperCAmelCase_						=				min(__SCREAMING_SNAKE_CASE			,     __SCREAMING_SNAKE_CASE			,     __SCREAMING_SNAKE_CASE )
				ugly_nums.append(__SCREAMING_SNAKE_CASE )
				if next_num == next_a:
						ia += 1
						UpperCAmelCase_						=				ugly_nums[ia] * 2
				if next_num == next_a:
						ia += 1
						UpperCAmelCase_						=				ugly_nums[ia] * 3
				if next_num == next_a:
						ia += 1
						UpperCAmelCase_						=				ugly_nums[ia] * 5
		return ugly_nums[-1]


if __name__ == "__main__":
			from doctest import testmod

			testmod(verbose=True)
			print(f'''{ugly_numbers(200) = }''')

