




def       UpperCAmelCase       (     _snake_case						, _snake_case							):
       lowerCAmelCase   =		''''''
       for i in table:
              res += inp[i - 1]
       return res



def       UpperCAmelCase       (     _snake_case							):
       return data[1:] + data[0]



def       UpperCAmelCase       (     _snake_case						, _snake_case							):
       lowerCAmelCase   =		''''''
       for i in range(len(UpperCAmelCase__							)							):
              if a[i] == b[i]:
                     res += "0"
              else:
                     res += "1"
       return res



def       UpperCAmelCase       (     _snake_case						, _snake_case							):
       lowerCAmelCase   =		int('''0b''' + data[0] + data[-1]						, 2							)
       lowerCAmelCase   =		int('''0b''' + data[1:3]						, 2							)
       return bin(s[row][col]							)[2:]



def       UpperCAmelCase       (     _snake_case						, _snake_case						, _snake_case						, _snake_case						, _snake_case							):
       lowerCAmelCase   =		message[:4]
       lowerCAmelCase   =		message[4:]
       lowerCAmelCase   =		apply_table(UpperCAmelCase__						, UpperCAmelCase__							)
       lowerCAmelCase   =		xor(UpperCAmelCase__						, UpperCAmelCase__							)
       lowerCAmelCase   =		apply_sbox(UpperCAmelCase__						, temp[:4]							)  # noqa: E741
       lowerCAmelCase   =		apply_sbox(UpperCAmelCase__						, temp[4:]							)
       lowerCAmelCase   =		'''0''' * (2 - len(UpperCAmelCase__							)) + l  # noqa: E741
       lowerCAmelCase   =		'''0''' * (2 - len(UpperCAmelCase__							)) + r
       lowerCAmelCase   =		apply_table(l + r						, UpperCAmelCase__							)
       lowerCAmelCase   =		xor(UpperCAmelCase__						, UpperCAmelCase__							)
       return temp + right


if __name__ == "__main__":
  UpperCAmelCase_						=input("""Enter 10 bit key: """)
  UpperCAmelCase_						=input("""Enter 8 bit message: """)

  UpperCAmelCase_						=[6, 3, 7, 4, 8, 5, 10, 9]
  UpperCAmelCase_						=[3, 5, 2, 7, 4, 10, 1, 9, 8, 6]
  UpperCAmelCase_						=[2, 4, 3, 1]
  UpperCAmelCase_						=[2, 6, 3, 1, 4, 8, 5, 7]
  UpperCAmelCase_						=[4, 1, 3, 5, 7, 2, 8, 6]
  UpperCAmelCase_						=[4, 1, 2, 3, 2, 3, 4, 1]
  UpperCAmelCase_						=[[1, 0, 3, 2], [3, 2, 1, 0], [0, 2, 1, 3], [3, 1, 3, 2]]
  UpperCAmelCase_						=[[0, 1, 2, 3], [2, 0, 1, 3], [3, 0, 1, 0], [2, 1, 0, 3]]

  # key generation
  UpperCAmelCase_						=apply_table(key, paa_table)
  UpperCAmelCase_						=temp[:5]
  UpperCAmelCase_						=temp[5:]
  UpperCAmelCase_						=left_shift(left)
  UpperCAmelCase_						=left_shift(right)
  UpperCAmelCase_						=apply_table(left + right, pa_table)
  UpperCAmelCase_						=left_shift(left)
  UpperCAmelCase_						=left_shift(right)
  UpperCAmelCase_						=left_shift(left)
  UpperCAmelCase_						=left_shift(right)
  UpperCAmelCase_						=apply_table(left + right, pa_table)

  # encryption
  UpperCAmelCase_						=apply_table(message, IP)
  UpperCAmelCase_						=function(expansion, sa, sa, keya, temp)
  UpperCAmelCase_						=temp[4:] + temp[:4]
  UpperCAmelCase_						=function(expansion, sa, sa, keya, temp)
  UpperCAmelCase_						=apply_table(temp, IP_inv)
  print("""Cipher text is:""", CT)

  # decryption
  UpperCAmelCase_						=apply_table(CT, IP)
  UpperCAmelCase_						=function(expansion, sa, sa, keya, temp)
  UpperCAmelCase_						=temp[4:] + temp[:4]
  UpperCAmelCase_						=function(expansion, sa, sa, keya, temp)
  UpperCAmelCase_						=apply_table(temp, IP_inv)
  print("""Plain text after decypting is:""", PT)









from collections.abc import Sequence



def       UpperCAmelCase       (     _snake_case						, _snake_case = False							):
							if not arr:
														return 0

							lowerCAmelCase   =		0 if allow_empty_subarrays else float('''-inf'''							)
							lowerCAmelCase   =		0.0
							for num in arr:
														lowerCAmelCase   =		max(0 if allow_empty_subarrays else num						, curr_sum + num							)
														lowerCAmelCase   =		max(_snake_case						, _snake_case							)

							return max_sum


if __name__ == "__main__":
		from doctest import testmod

		testmod()

		UpperCAmelCase_						=[-2, 1, -3, 4, -1, 2, 1, -5, 4]
		print(F'''{max_subarray_sum(nums) = }''')



