
"""simple docstring"""



from typing import List

import numpy as np


def lowerCamelCase_				(     _lowerCamelCase			:	dict				):
       lowerCamelCase_       							=		{key: len(_lowerCamelCase				) for key, value in gen_kwargs.items() if isinstance(_lowerCamelCase					,				_lowerCamelCase				)}
       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.'''
                  )				)
       lowerCamelCase_       							=		max(lists_lengths.values()					,				default=0				)
       return max(1					,				_lowerCamelCase				)


def lowerCamelCase_				(     _lowerCamelCase			:	int					,				_lowerCamelCase			:	int				):
       lowerCamelCase_       							=		[]
       for group_idx in range(_lowerCamelCase				):
              lowerCamelCase_       							=		num_shards // max_num_jobs + (group_idx < (num_shards % max_num_jobs))
              if num_shards_to_add == 0:
                     break
              lowerCamelCase_       							=		shards_indices_per_group[-1].stop if shards_indices_per_group else 0
              lowerCamelCase_       							=		range(_lowerCamelCase					,				start + num_shards_to_add				)
              shards_indices_per_group.append(_lowerCamelCase				)
       return shards_indices_per_group


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


def lowerCamelCase_				(     _lowerCamelCase			:	List[dict]				):
       return {
           key: [value for gen_kwargs in gen_kwargs_list for value in gen_kwargs[key]]
           if isinstance(gen_kwargs_list[0][key]					,				_lowerCamelCase				)
           else gen_kwargs_list[0][key]
           for key in gen_kwargs_list[0]
       }





def lowerCamelCase_				(     _lowerCamelCase			:	np.random.Generator					,				_lowerCamelCase			:	dict				):
       lowerCamelCase_       							=		{len(_lowerCamelCase				) for value in gen_kwargs.values() if isinstance(_lowerCamelCase					,				_lowerCamelCase				)}
       lowerCamelCase_       							=		{}
       for size in list_sizes:
              lowerCamelCase_       							=		list(range(_lowerCamelCase				)				)
              rng.shuffle(indices_per_size[size]				)
       # Now let's copy the gen_kwargs and shuffle the lists based on their sizes
       lowerCamelCase_       							=		dict(_lowerCamelCase				)
       for key, value in shuffled_kwargs.items():
              if isinstance(_lowerCamelCase					,				_lowerCamelCase				):
                     lowerCamelCase_       							=		[value[i] for i in indices_per_size[len(_lowerCamelCase				)]]
       return shuffled_kwargs
def 	lowerCamelCase					(	UpperCamelCase     :				int							)   ->    bool:
		_lowerCamelCase				   =  (1 + 24 * n) ** 0.5
		return ((1 + root) / 6) % 1 == 0


def 	lowerCamelCase					(	UpperCamelCase     :				int = 50_00							)   ->    int:
		_lowerCamelCase				   =  [(i * (3 * i - 1)) // 2 for i in range(1			,       UpperCamelCase							)]
		for i, pentagonal_i in enumerate(UpperCamelCase							):
				for j in range(UpperCamelCase			,       len(UpperCamelCase							)							):
						_lowerCamelCase				   =  pentagonal_nums[j]
						_lowerCamelCase				   =  pentagonal_i + pentagonal_j
						_lowerCamelCase				   =  pentagonal_j - pentagonal_i
						if is_pentagonal(UpperCamelCase							) and is_pentagonal(UpperCamelCase							):
								return b

		return -1


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