


from __future__ import annotations

from sys import maxsize
from typing import Generic, TypeVar

__UpperCamelCase       :       int						       =				TypeVar("T")

def 			_a  (				SCREAMING_SNAKE_CASE	:				int     ):







 """simple docstring"""



 return (position - 1) // 2

def 			_a  (				SCREAMING_SNAKE_CASE	:				int     ):







 """simple docstring"""



 return (2 * position) + 1

def 			_a  (				SCREAMING_SNAKE_CASE	:				int     ):







 """simple docstring"""



 return (2 * position) + 2

class       __magic_name__	(     Generic[T]):


     def __init__(      self							:     List[str]			)  ->      None:





      '''simple docstring'''






      UpperCamelCase__					:    list[tuple[T, int]]          =   []
      UpperCamelCase__					:    dict[T, int]          =   {}
      UpperCamelCase__					:    int          =   0


     def __len__(      self							:     Optional[int]			)  ->      int:





      '''simple docstring'''






      return self.elements


     def __repr__(      self							:     Dict			)  ->      str:





      '''simple docstring'''






      return str(self.heap			)


     def      UpperCAmelCase__	(      self							:     Optional[Any]			)  ->      bool:





      '''simple docstring'''






      return self.elements == 0


     def      UpperCAmelCase__	(      self							:     int							,	lowerCamelCase__							:     T							,	lowerCamelCase__							:     int			)  ->      None:





      '''simple docstring'''






      self.heap.append((elem, weight)			)
      UpperCamelCase__					:    Dict          =   self.elements
      self.elements += 1
      self._bubble_up(lowerCamelCase__			)


     def      UpperCAmelCase__	(      self							:     Dict			)  ->      T:





      '''simple docstring'''






      if self.elements > 1:
       self._swap_nodes(0							,	self.elements - 1			)
      UpperCamelCase__       ,				UpperCamelCase__					:    Dict          =   self.heap.pop()
      del self.position_map[elem]
      self.elements -= 1
      if self.elements > 0:
       UpperCamelCase__       ,				UpperCamelCase__					:    Tuple          =   self.heap[0]
       self._bubble_down(lowerCamelCase__			)
      return elem


     def      UpperCAmelCase__	(      self							:     Optional[Any]							,	lowerCamelCase__							:     T							,	lowerCamelCase__							:     int			)  ->      None:





      '''simple docstring'''






      UpperCamelCase__					:    List[Any]          =   self.position_map[elem]
      UpperCamelCase__					:    int          =   (elem, weight)
      if position > 0:
       UpperCamelCase__					:    List[str]          =   get_parent_position(lowerCamelCase__			)
       UpperCamelCase__       ,				UpperCamelCase__					:    Union[str, Any]          =   self.heap[parent_position]
       if parent_weight > weight:
        self._bubble_up(lowerCamelCase__			)
       else:
        self._bubble_down(lowerCamelCase__			)
      else:
       self._bubble_down(lowerCamelCase__			)


     def      UpperCAmelCase__	(      self							:     str							,	lowerCamelCase__							:     T			)  ->      None:





      '''simple docstring'''






      UpperCamelCase__					:    int          =   self.position_map[elem]
      if curr_pos == 0:
       return None
      UpperCamelCase__					:    Dict          =   get_parent_position(lowerCamelCase__			)
      UpperCamelCase__       ,				UpperCamelCase__					:    int          =   self.heap[curr_pos]
      UpperCamelCase__       ,				UpperCamelCase__					:    Dict          =   self.heap[parent_position]
      if parent_weight > weight:
       self._swap_nodes(lowerCamelCase__							,	lowerCamelCase__			)
       return self._bubble_up(lowerCamelCase__			)
      return None


     def      UpperCAmelCase__	(      self							:     Union[str, Any]							,	lowerCamelCase__							:     T			)  ->      None:





      '''simple docstring'''






      UpperCamelCase__					:    str          =   self.position_map[elem]
      UpperCamelCase__       ,				UpperCamelCase__					:    Tuple          =   self.heap[curr_pos]
      UpperCamelCase__					:    Dict          =   get_child_left_position(lowerCamelCase__			)
      UpperCamelCase__					:    Tuple          =   get_child_right_position(lowerCamelCase__			)
      if child_left_position < self.elements and child_right_position < self.elements:
       UpperCamelCase__       ,				UpperCamelCase__					:    List[str]          =   self.heap[child_left_position]
       UpperCamelCase__       ,				UpperCamelCase__					:    List[Any]          =   self.heap[child_right_position]
       if child_right_weight < child_left_weight and child_right_weight < weight:
        self._swap_nodes(lowerCamelCase__							,	lowerCamelCase__			)
        return self._bubble_down(lowerCamelCase__			)
      if child_left_position < self.elements:
       UpperCamelCase__       ,				UpperCamelCase__					:    Union[str, Any]          =   self.heap[child_left_position]
       if child_left_weight < weight:
        self._swap_nodes(lowerCamelCase__							,	lowerCamelCase__			)
        return self._bubble_down(lowerCamelCase__			)
      else:
       return None
      if child_right_position < self.elements:
       UpperCamelCase__       ,				UpperCamelCase__					:    List[Any]          =   self.heap[child_right_position]
       if child_right_weight < weight:
        self._swap_nodes(lowerCamelCase__							,	lowerCamelCase__			)
        return self._bubble_down(lowerCamelCase__			)
      return None


     def      UpperCAmelCase__	(      self							:     str							,	lowerCamelCase__							:     int							,	lowerCamelCase__							:     int			)  ->      None:





      '''simple docstring'''






      UpperCamelCase__					:    Any          =   self.heap[nodea_pos][0]
      UpperCamelCase__					:    str          =   self.heap[nodea_pos][0]
      UpperCamelCase__       ,				UpperCamelCase__					:    Optional[int]          =   (
          self.heap[nodea_pos],
          self.heap[nodea_pos],
      )
      UpperCamelCase__					:    str          =   nodea_pos
      UpperCamelCase__					:    List[str]          =   nodea_pos



class       __magic_name__	(     Generic[T]):


     def __init__(      self							:     List[Any]			)  ->      None:





      '''simple docstring'''






      UpperCamelCase__					:    dict[T, dict[T, int]]          =   {}
      UpperCamelCase__					:    int          =   0


     def __repr__(      self							:     List[str]			)  ->      str:





      '''simple docstring'''






      return str(self.connections			)


     def __len__(      self							:     Any			)  ->      int:





      '''simple docstring'''






      return self.nodes


     def      UpperCAmelCase__	(      self							:     List[str]							,	lowerCamelCase__							:     T			)  ->      None:





      '''simple docstring'''






      if node not in self.connections:
       UpperCamelCase__					:    Optional[int]          =   {}
       self.nodes += 1


     def      UpperCAmelCase__	(      self							:     Dict							,	lowerCamelCase__							:     T							,	lowerCamelCase__							:     T							,	lowerCamelCase__							:     int			)  ->      None:





      '''simple docstring'''






      self.add_node(lowerCamelCase__			)
      self.add_node(lowerCamelCase__			)
      UpperCamelCase__					:    int          =   weight
      UpperCamelCase__					:    Any          =   weight



def 			_a  (				SCREAMING_SNAKE_CASE	:				GraphUndirectedWeighted[T]    , ):







 """simple docstring"""



 UpperCamelCase__					:    dict[T, int]          =   {node: maxsize for node in graph.connections}
 UpperCamelCase__					:    dict[T, T | None]          =   {node: None for node in graph.connections}

 UpperCamelCase__					:    MinPriorityQueue[T]          =   MinPriorityQueue()
 for node, weight in dist.items():
  priority_queue.push(SCREAMING_SNAKE_CASE    , SCREAMING_SNAKE_CASE     )

 if priority_queue.is_empty():
  return dist, parent

 # initialization
 UpperCamelCase__					:    str          =   priority_queue.extract_min()
 UpperCamelCase__					:    Dict          =   0
 for neighbour in graph.connections[node]:
  if dist[neighbour] > dist[node] + graph.connections[node][neighbour]:
   UpperCamelCase__					:    List[Any]          =   dist[node] + graph.connections[node][neighbour]
   priority_queue.update_key(SCREAMING_SNAKE_CASE    , dist[neighbour]     )
   UpperCamelCase__					:    int          =   node

    # running prim's algorithm
 while not priority_queue.is_empty():
  UpperCamelCase__					:    Tuple          =   priority_queue.extract_min()
  for neighbour in graph.connections[node]:
   if dist[neighbour] > dist[node] + graph.connections[node][neighbour]:
    UpperCamelCase__					:    Any          =   dist[node] + graph.connections[node][neighbour]
    priority_queue.update_key(SCREAMING_SNAKE_CASE    , dist[neighbour]     )
    UpperCamelCase__					:    int          =   node
 return dist, parent






from __future__ import annotations

from collections.abc import Generator

import requests
from bsa import BeautifulSoup

__UpperCamelCase       :       int						       =				"https://www.indeed.co.in/jobs?q=mobile+app+development&l="

def 			_a  (				SCREAMING_SNAKE_CASE	:				str = "mumbai"     ):







 """simple docstring"""



 UpperCamelCase__					:    Optional[int]          =   BeautifulSoup(requests.get(url + location     ).content    , '''html.parser'''     )
 # This attribute finds out all the specifics listed in a job
 for job in soup.find_all('''div'''    , attrs={'''data-tn-component''': '''organicJob'''}     ):
  UpperCamelCase__					:    Optional[Any]          =   job.find('''a'''    , attrs={'''data-tn-element''': '''jobTitle'''}     ).text.strip()
  UpperCamelCase__					:    Union[str, Any]          =   job.find('''span'''    , {'''class''': '''company'''}     ).text.strip()
  yield job_title, company_name


if __name__ == "__main__":
       for i, job in enumerate(fetch_jobs("Bangalore"), 1):
              print(f"Job {i:>2} is {job[0]} at {job[1]}")


