"""simple docstring"""





import math





def        a_  (   _lowerCAmelCase						:				int  ):





       '''simple docstring'''

       lowercase__    :	Optional[Any]     					=			[]
       lowercase__    :	str     					=			2
       lowercase__    :	Dict     					=			int(math.sqrt(_lowerCAmelCase  )  )  # Size of every segment
       lowercase__    :	List[Any]     					=			[True] * (end + 1)
       lowercase__    :	Any     					=			[]

       while start <= end:
              if temp[start] is True:
                     in_prime.append(_lowerCAmelCase  )
                     for i in range(start * start     ,				end + 1     ,				_lowerCAmelCase  ):
                            lowercase__    :	Any     					=			False
              start += 1
       prime += in_prime

       lowercase__    :	Union[str, Any]     					=			end + 1
       lowercase__    :	Any     					=			min(2 * end     ,				_lowerCAmelCase  )

       while low <= n:
              lowercase__    :	Any     					=			[True] * (high - low + 1)
              for each in in_prime:
                     lowercase__    :	List[str]     					=			math.floor(low / each  ) * each
                     if t < low:
                            t += each

                     for j in range(_lowerCAmelCase     ,				high + 1     ,				_lowerCAmelCase  ):
                            lowercase__    :	Tuple     					=			False

              for j in range(len(_lowerCAmelCase  )  ):
                     if temp[j] is True:
                            prime.append(j + low  )

              lowercase__    :	Any     					=			high + 1
              lowercase__    :	int     					=			min(high + end     ,				_lowerCAmelCase  )

       return prime






print(sieve(10**6))


"""simple docstring"""





def        a_  (   _lowerCAmelCase						:				str  ):





       '''simple docstring'''

       lowercase__    :	Any     					=			[0] * len(_lowerCAmelCase  )

       for i in range(1     ,				len(_lowerCAmelCase  )  ):
              # use last results for better performance - dynamic programming
              lowercase__    :	List[str]     					=			prefix_result[i - 1]
              while j > 0 and input_string[i] != input_string[j]:
                     lowercase__    :	Dict     					=			prefix_result[j - 1]

              if input_string[i] == input_string[j]:
                     j += 1
              lowercase__    :	Union[str, Any]     					=			j

       return prefix_result





def        a_  (   _lowerCAmelCase						:				str  ):





       '''simple docstring'''

       return max(prefix_function(_lowerCAmelCase  )  )


if __name__ == "__main__":
       import doctest

       doctest.testmod()

