



"""simple docstring"""
from typing import List

import numpy as np
def    A_  (			_lowercase	):







						'''simple docstring'''


						snake_case_ :Optional[Any]						=			{key: len(A__	) for key, value in gen_kwargs.items() if isinstance(A__,					A__	)}
						if len(set(lists_lengths.values()	)	) > 1:
												raise RuntimeError(
												    (
												        """Sharding is ambiguous for this dataset: """
												        + """we found several data sources lists of different lengths, and we don't know over which list we should parallelize:\n"""
												        + """\n""".join(f"""\t- key {key} has length {length}""" for key, length in lists_lengths.items()	)
												        + """\nTo fix this, check the 'gen_kwargs' and make sure to use lists only for data sources, """
												        + """and use tuples otherwise. In the end there should only be one single list, or several lists with the same length."""
												    )	)
						snake_case_ :Tuple						=			max(lists_lengths.values(),					default=0	)
						return max(1,					A__	)
def    A_  (			_lowercase,					_lowercase	):







						'''simple docstring'''


						snake_case_ :Union[str, Any]						=			[]
						for group_idx in range(A__	):
												snake_case_ :List[str]						=			num_shards // max_num_jobs + (group_idx < (num_shards % max_num_jobs))
												if num_shards_to_add == 0:
																		break
												snake_case_ :List[str]						=			shards_indices_per_group[-1].stop if shards_indices_per_group else 0
												snake_case_ :Any						=			range(A__,					start + num_shards_to_add	)
												shards_indices_per_group.append(A__	)
						return shards_indices_per_group
def    A_  (			_lowercase,					_lowercase	):







						'''simple docstring'''


						snake_case_ :Optional[int]						=			_number_of_shards_in_gen_kwargs(A__	)
						if num_shards == 1:
												return [dict(A__	)]
						else:
												snake_case_ :Tuple						=			_distribute_shards(num_shards=A__,					max_num_jobs=A__	)
												return [
												    {
												        key: [value[shard_idx] for shard_idx in shard_indices_per_group[group_idx]]
												        if isinstance(A__,					A__	)
												        else value
												        for key, value in gen_kwargs.items()
												    }
												    for group_idx in range(len(A__	)	)
												]
def    A_  (			_lowercase	):







						'''simple docstring'''


						return {
						    key: [value for gen_kwargs in gen_kwargs_list for value in gen_kwargs[key]]
						    if isinstance(gen_kwargs_list[0][key],					A__	)
						    else gen_kwargs_list[0][key]
						    for key in gen_kwargs_list[0]
						}

def    A_  (			_lowercase,					_lowercase	):







						'''simple docstring'''


						snake_case_ :List[str]						=			{len(A__	) for value in gen_kwargs.values() if isinstance(A__,					A__	)}
						snake_case_ :List[str]						=			{}
						for size in list_sizes:
												snake_case_ :Optional[int]						=			list(range(A__	)	)
												rng.shuffle(indices_per_size[size]	)
						# Now let's copy the gen_kwargs and shuffle the lists based on their sizes
						snake_case_ :int						=			dict(A__	)
						for key, value in shuffled_kwargs.items():
												if isinstance(A__,					A__	):
																		snake_case_ :int						=			[value[i] for i in indices_per_size[len(A__	)]]
						return shuffled_kwargs




'''simple docstring'''






def 				UpperCamelCase_			(    A__					:   int					):
  '''simple docstring'''





  lowerCAmelCase_			:      Union[str, Any]			=   (1 + 24 * n) ** 0.5
  return ((1 + root) / 6) % 1 == 0







def 				UpperCamelCase_			(    A__					:   int = 50_00					):
  '''simple docstring'''





  lowerCAmelCase_			:      Optional[int]			=   [(i * (3 * i - 1)) // 2 for i in range(1							,    A__					)]
  for i, pentagonal_i in enumerate(A__					):
    for j in range(A__							,    len(A__					)					):
      lowerCAmelCase_			:      int			=   pentagonal_nums[j]
      lowerCAmelCase_			:      Union[str, Any]			=   pentagonal_i + pentagonal_j
      lowerCAmelCase_			:      List[Any]			=   pentagonal_j - pentagonal_i
      if is_pentagonal(A__					) and is_pentagonal(A__					):
        return b

  return -1


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



