


"""simple docstring"""







from __future__ import annotations

from collections import deque






class 						_A  :







    """simple docstring"""




    def __init__(					self				:    str				, __UpperCAmelCase				:    list[str]):
      a						:		list[dict]      							=			[]
      self.adlist.append(
          {"value": "", "next_states": [], "fail_state": 0, "output": []})

      for keyword in keywords:
        self.add_keyword(__UpperCAmelCase)
      self.set_fail_transitions()






    def 	__snake_case							(					self				:    Dict				, __UpperCAmelCase				:    int				, __UpperCAmelCase				:    str):
      for state in self.adlist[current_state]["next_states"]:
        if char == self.adlist[state]["value"]:
          return state
      return None






    def 	__snake_case							(					self				:    str				, __UpperCAmelCase				:    str):
      a						:		Dict      							=			0
      for character in keyword:
        a						:		Any      							=			self.find_next_state(__UpperCAmelCase				, __UpperCAmelCase)
        if next_state is None:
          self.adlist.append(
              {
                  "value": character,
                  "next_states": [],
                  "fail_state": 0,
                  "output": [],
              })
          self.adlist[current_state]["next_states"].append(len(self.adlist) - 1)
          a						:		Tuple      							=			len(self.adlist) - 1
        else:
          a						:		Tuple      							=			next_state
      self.adlist[current_state]["output"].append(__UpperCAmelCase)






    def 	__snake_case							(					self				:    Optional[Any]):
      a						:		deque      							=			deque()
      for node in self.adlist[0]["next_states"]:
        q.append(__UpperCAmelCase)
        a						:		Optional[Any]      							=			0
      while q:
        a						:		Optional[int]      							=			q.popleft()
        for child in self.adlist[r]["next_states"]:
          q.append(__UpperCAmelCase)
          a						:		List[str]      							=			self.adlist[r]["fail_state"]
          while (
              self.find_next_state(__UpperCAmelCase				, self.adlist[child]["value"]) is None
              and state != 0
          ):
            a						:		Optional[int]      							=			self.adlist[state]["fail_state"]
          a						:		Dict      							=			self.find_next_state(
              __UpperCAmelCase				, self.adlist[child]["value"])
          if self.adlist[child]["fail_state"] is None:
            a						:		Optional[int]      							=			0
          a						:		Union[str, Any]      							=			(
              self.adlist[child]["output"]
              + self.adlist[self.adlist[child]["fail_state"]]["output"]
          )






    def 	__snake_case							(					self				:    List[Any]				, __UpperCAmelCase				:    str):
      a						:		dict      							=			{}  # returns a dict with keywords and list of its occurrences
      a						:		Any      							=			0
      for i in range(len(__UpperCAmelCase)):
        while (
            self.find_next_state(__UpperCAmelCase				, string[i]) is None
            and current_state != 0
        ):
          a						:		Any      							=			self.adlist[current_state]["fail_state"]
        a						:		str      							=			self.find_next_state(__UpperCAmelCase				, string[i])
        if next_state is None:
          a						:		Dict      							=			0
        else:
          a						:		Optional[int]      							=			next_state
          for key in self.adlist[current_state]["output"]:
            if key not in result:
              a						:		List[str]      							=			[]
            result[key].append(i - len(__UpperCAmelCase) + 1)
      return result


if __name__ == "__main__":
 import doctest

 doctest.testmod()











def 	__UpperCamelCase	(  _lowerCAmelCase = 100_0000		)       ->  int:



    """simple docstring"""






    A :       str          =   limit + 1
    A :       Tuple          =   [0] * limit
    for first_term in range(1      ,     _lowerCAmelCase		):
        for n in range(_lowerCAmelCase      ,     _lowerCAmelCase      ,     _lowerCAmelCase		):
            A :       Any          =   first_term + n / first_term
            if common_difference % 4:  # d must be divisble by 4
                continue
            else:
                common_difference /= 4
                if (
                    first_term > common_difference
                    and first_term < 4 * common_difference
                ):  # since x,y,z are positive integers
                    frequency[n] += 1  # so z>0 and a>d ,also 4d<a

    A :       Optional[int]          =   sum(1 for x in frequency[1:limit] if x == 10		)

    return count


if __name__ == "__main__":
     print(F"""{solution() = }""")


