




from math import ceil



def       UpperCAmelCase__  (     lowerCamelCase,			lowerCamelCase   ):
  lowercase    :List[str]      	=						list(range(0,			lowerCamelCase   )   )

  lowercase    :List[str]      	=						[item for sublist in list(device_map.values()   ) for item in sublist]

  # Duplicate check
  lowercase    :Tuple      	=						[]
  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
  lowercase    :str      	=						[i for i in blocks if i not in device_map_blocks]
  lowercase    :List[str]      	=						[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       UpperCAmelCase__  (     lowerCamelCase,			lowerCamelCase   ):
  lowercase    :List[Any]      	=						list(range(lowerCamelCase   )   )
  lowercase    :Dict      	=						int(ceil(n_layers / len(lowerCamelCase   )   )   )
  lowercase    :str      	=						[layers[i : i + n_blocks] for i in range(0,			lowerCamelCase,			lowerCamelCase   )]

  return dict(zip(lowerCamelCase,			lowerCamelCase   )   )









def       UpperCAmelCase__  (     lowerCamelCase   ):
  if divisor % 5 == 0 or divisor % 2 == 0:
    return 0
  lowercase    :str      	=						1
  lowercase    :Tuple      	=						1
  while repunit:
    lowercase    :Dict      	=						(10 * repunit + 1) % divisor
    repunit_index += 1
  return repunit_index



def       UpperCAmelCase__  (     lowerCamelCase = 1000000   ):
  lowercase    :List[Any]      	=						limit - 1
  if divisor % 2 == 0:
    divisor += 1
  while least_divisible_repunit(lowerCamelCase   ) <= limit:
    divisor += 2
  return divisor


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



