


'''simple docstring'''






import webbrowser
from sys import argv
from urllib.parse import parse_qs, quote

import requests
from bsa import BeautifulSoup
from fake_useragent import UserAgent

if __name__ == "__main__":
 a_   :      Union[str, Any]				    =      "%20".join(argv[1:]) if len(argv) > 1 else quote(str(input("Search: ")))

 print("Googling.....")

 a_   :      Optional[Any]				    =      f'''https://www.google.com/search?q={query}&num=100'''

 a_   :      Tuple				    =      requests.get(
     url,
     headers={"User-Agent": str(UserAgent().random)},
 )

 try:
  a_   :      List[str]				    =      (
      BeautifulSoup(res.text, "html.parser")
      .find("div", attrs={"class": "yuRUbf"})
      .find("a")
      .get("href")
  )

 except AttributeError:
  a_   :      int				    =      parse_qs(
      BeautifulSoup(res.text, "html.parser")
      .find("div", attrs={"class": "kCrYT"})
      .find("a")
      .get("href")
  )["url"][0]

 webbrowser.open(link)





'''simple docstring'''






def 		_A			(lowerCAmelCase__					:list						)				->					float:




     '''simple docstring'''



     _a      =							0
     while len(lowerCAmelCase__						) > 1:
          _a      =							0
          # Consider two files with minimum cost to be merged
          for _ in range(2						):
               _a      =							files.index(min(lowerCAmelCase__						)						)
               temp += files[min_index]
               files.pop(lowerCAmelCase__						)
          files.append(lowerCAmelCase__						)
          optimal_merge_cost += temp
     return optimal_merge_cost


if __name__ == "__main__":
 import doctest

 doctest.testmod()

