
A     :	Dict    = 2_5_6
# Modulus to hash a string
A     :	Tuple    = 1_0_0_0_0_0_3


def     __lowerCAmelCase			(			a__						,    a__  )       ->  bool:
				__a										=    len(a__  )
				__a										=    len(a__  )
				if p_len > t_len:
								return False

				__a										=    0
				__a										=    0
				__a										=    1

				# Calculating the hash of pattern and substring of text
				for i in range(a__  ):
								__a										=    (ord(pattern[i]  ) + p_hash * alphabet_size) % modulus
								__a										=    (ord(text[i]  ) + text_hash * alphabet_size) % modulus
								if i == p_len - 1:
												continue
								__a										=    (modulus_power * alphabet_size) % modulus

				for i in range(0						,    t_len - p_len + 1  ):
								if text_hash == p_hash and text[i : i + p_len] == pattern:
												return True
								if i == t_len - p_len:
												continue
								# Calculate the https://en.wikipedia.org/wiki/Rolling_hash
								__a										=    (
								    (text_hash - ord(text[i]  ) * modulus_power) * alphabet_size
								    + ord(text[i + p_len]  )
								) % modulus
				return False


def     __lowerCAmelCase			(			)       ->  None:
				__a										=    '''abc1abc12'''
				__a										=    '''alskfjaldsabc1abc1abc12k23adsfabcabc'''
				__a										=    '''alskfjaldsk23adsfabcabc'''
				assert rabin_karp(a__						,    a__  ) and not rabin_karp(a__						,    a__  )

				# Test 2)
				__a										=    '''ABABX'''
				__a										=    '''ABABZABABYABABX'''
				assert rabin_karp(a__						,    a__  )

				# Test 3)
				__a										=    '''AAAB'''
				__a										=    '''ABAAAAAB'''
				assert rabin_karp(a__						,    a__  )

				# Test 4)
				__a										=    '''abcdabcy'''
				__a										=    '''abcxabcdabxabcdabcdabcy'''
				assert rabin_karp(a__						,    a__  )

				# Test 5)
				__a										=    '''Lü'''
				__a										=    '''Lüsai'''
				assert rabin_karp(a__						,    a__  )
				__a										=    '''Lue'''
				assert not rabin_karp(a__						,    a__  )
				print('''Success.'''  )


if __name__ == "__main__":
					test_rabin_karp()

from math import ceil


def     __lowerCAmelCase			(			a__ = 1001  )       ->  int:
				__a										=    1

				for i in range(1						,    int(ceil(n / 2.0  )  )  ):
								__a										=    2 * i + 1
								__a										=    2 * i
								__a										=    total + 4 * odd**2 - 6 * even

				return total


if __name__ == "__main__":
					import sys

					if len(sys.argv) == 1:
										print(solution())
					else:
										try:
															A     :	List[Any]    = int(sys.argv[1])
															print(solution(n))
										except ValueError:
															print('Invalid entry - please enter a number')