






"""simple docstring"""






SCREAMING_SNAKE_CASE						:						dict[tuple[int, int, int], int]					   =       {}



def  __lowerCamelCase					(					lowerCAmelCase__       ,lowerCAmelCase__       ,lowerCAmelCase__				):

				# if we are absent twice, or late 3 consecutive days,
				# no further prize strings are possible
				if late == 3 or absent == 2:
								return 0

				# if we have no days left, and have not failed any other rules,
				# we have a prize string
				if days == 0:
								return 1

				# No easy solution, so now we need to do the recursive calculation

				# First, check if the combination is already in the cache, and
				# if yes, return the stored value from there since we already
				# know the number of possible prize strings from this point on
				A__							 =       (days, absent, late)
				if key in cache:
								return cache[key]

				# now we calculate the three possible ways that can unfold from
				# this point on, depending on our attendance today

				# 1) if we are late (but not absent), the "absent" counter stays as
				# it is, but the "late" counter increases by one
				A__							 =       _calculate(days - 1       ,lowerCAmelCase__       ,late + 1				)

				# 2) if we are absent, the "absent" counter increases by 1, and the
				# "late" counter resets to 0
				A__							 =       _calculate(days - 1       ,absent + 1       ,0				)

				# 3) if we are on time, this resets the "late" counter and keeps the
				# absent counter
				A__							 =       _calculate(days - 1       ,lowerCAmelCase__       ,0				)

				A__							 =       state_late + state_absent + state_ontime

				A__							 =       prizestrings
				return prizestrings



def  __lowerCamelCase					(					lowerCAmelCase__ = 30				):
				return _calculate(lowerCAmelCase__       ,absent=0       ,late=0				)


if __name__ == "__main__":
					print(solution())










"""simple docstring"""






from math import ceil



def  __lowerCamelCase					(					lowerCAmelCase__       ,lowerCAmelCase__				):
				A__							 =       list(range(0       ,lowerCAmelCase__				)				)

				A__							 =       [item for sublist in list(device_map.values()				) for item in sublist]

				# Duplicate check
				A__							 =       []
				for i in device_map_blocks:
								if device_map_blocks.count(lowerCAmelCase__				) > 1 and i not in duplicate_blocks:
												duplicate_blocks.append(lowerCAmelCase__				)
    # Missing blocks
				A__							 =       [i for i in blocks if i not in device_map_blocks]
				A__							 =       [i for i in device_map_blocks if i not in blocks]

				if len(lowerCAmelCase__				) != 0:
								raise ValueError(
								    'Duplicate attention blocks specified in device_map. Attention blocks must be specified to one device.'
								    ' These attention blocks were specified more than once: ' + str(lowerCAmelCase__				)				)
				if len(lowerCAmelCase__				) != 0:
								raise ValueError(
								    'There are attention blocks for this model that are not specified in the device_map. Add these attention '
								    'blocks to a device on the device_map: ' + str(lowerCAmelCase__				)				)
				if len(lowerCAmelCase__				) != 0:
								raise ValueError(
								    'The device_map contains more attention blocks than this model has. Remove these from the device_map:'
								    + str(lowerCAmelCase__				)				)







def  __lowerCamelCase					(					lowerCAmelCase__       ,lowerCAmelCase__				):
				A__							 =       list(range(lowerCAmelCase__				)				)
				A__							 =       int(ceil(n_layers / len(lowerCAmelCase__				)				)				)
				A__							 =       [layers[i : i + n_blocks] for i in range(0       ,lowerCAmelCase__       ,lowerCAmelCase__				)]

				return dict(zip(lowerCAmelCase__       ,lowerCAmelCase__				)				)


