
"""simple docstring"""







def     __lowerCAmelCase				(_UpperCamelCase		):
	if not head:
		return True
	# split the list to two parts
	__lowerCAmelCase			,   __lowerCAmelCase			:						Optional[int]									=      head.next, head
	while fast and fast.next:
		__lowerCAmelCase			:						Any									=      fast.next.next
		__lowerCAmelCase			:						Any									=      slow.next
	__lowerCAmelCase			:						Optional[Any]									=      slow.next
	__lowerCAmelCase			:						Tuple									=      None  # Don't forget here! But forget still works!
	# reverse the second part
	__lowerCAmelCase			:						Union[str, Any]									=      None
	while second:
		__lowerCAmelCase			:						List[Any]									=      second.next
		__lowerCAmelCase			:						Optional[Any]									=      node
		__lowerCAmelCase			:						List[str]									=      second
		__lowerCAmelCase			:						int									=      nxt
	# compare two parts
	# second part has the same or one less node
	while node:
		if node.val != head.val:
			return False
		__lowerCAmelCase			:						Any									=      node.next
		__lowerCAmelCase			:						Any									=      head.next
	return True
def     __lowerCAmelCase				(_UpperCamelCase		):
	if not head or not head.next:
		return True

	# 1. Get the midpoint (slow)
	__lowerCAmelCase			:						Optional[int]									=      head
	while fast and fast.next:
		__lowerCAmelCase			,   __lowerCAmelCase			:						List[str]									=      fast.next.next, slow.next

	# 2. Push the second half into the stack
	__lowerCAmelCase			:						Tuple									=      [slow.val]
	while slow.next:
		__lowerCAmelCase			:						Dict									=      slow.next
		stack.append(slow.val		)

	# 3. Comparison
	while stack:
		if stack.pop() != cur.val:
			return False
		__lowerCAmelCase			:						Tuple									=      cur.next

	return True
def     __lowerCAmelCase				(_UpperCamelCase		):
	if not head or not head.next:
		return True
	__lowerCAmelCase			:						Tuple									=      {}
	__lowerCAmelCase			:						Optional[Any]									=      0
	while head:
		if head.val in d:
			d[head.val].append(_UpperCamelCase		)
		else:
			__lowerCAmelCase			:						Dict									=      [pos]
		__lowerCAmelCase			:						int									=      head.next
		pos += 1
	__lowerCAmelCase			:						Union[str, Any]									=      pos - 1
	__lowerCAmelCase			:						List[Any]									=      0
	for v in d.values():
		if len(_UpperCamelCase		) % 2 != 0:
			middle += 1
		else:
			__lowerCAmelCase			:						List[str]									=      0
			for i in range(0       ,  len(_UpperCamelCase		)		):
				if v[i] + v[len(_UpperCamelCase		) - 1 - step] != checksum:
					return False
				step += 1
		if middle > 1:
			return False
	return True







"""simple docstring"""


from collections import defaultdict
from math import ceil, sqrt



def 					lowerCAmelCase				(    __UpperCamelCase = 1_0_0_0_0_0_0		,       __UpperCamelCase = 1_0 ):




  """simple docstring"""







  __A									= defaultdict(__UpperCamelCase )

  for outer_width in range(3		,       (t_limit // 4) + 2 ):
    if outer_width * outer_width > t_limit:
      __A									= max(
          ceil(sqrt(outer_width * outer_width - t_limit ) )		,       1 )
    else:
      __A									= 1

    hole_width_lower_bound += (outer_width - hole_width_lower_bound) % 2

    for hole_width in range(__UpperCamelCase		,       outer_width - 1		,       2 ):
      count[outer_width * outer_width - hole_width * hole_width] += 1

  return sum(1 for n in count.values() if 1 <= n <= 1_0 )


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




