





"""simple docstring"""




import itertools





def 			a_							(				_lowercase = 100_0000  ):
						_UpperCamelCase     :   Any      =       [1]

						for i in itertools.count(len(_lowercase  )  ):
												_UpperCamelCase     :   Optional[Any]      =       0
												for j in itertools.count(1  ):
																		_UpperCamelCase     :   List[str]      =       -1 if j % 2 == 0 else +1
																		_UpperCamelCase     :   Tuple      =       (j * j * 3 - j) // 2
																		if index > i:
																								break
																		item += partitions[i - index] * sign
																		item %= number
																		index += j
																		if index > i:
																								break
																		item += partitions[i - index] * sign
																		item %= number

												if item == 0:
																		return i
												partitions.append(_lowercase  )

						return 0


if __name__ == "__main__":
						import doctest

						doctest.testmod()

						print(F"{solution() = }")




"""simple docstring"""







from typing import TypeVar

from .arrow_dataset import Dataset, _split_by_node_map_style_dataset
from .iterable_dataset import IterableDataset, _split_by_node_iterable_dataset


_a	:	List[Any]=					TypeVar("DatasetType", Dataset, IterableDataset)
def     __UpperCAmelCase							(       UpperCAmelCase_       :							DatasetType     ,				UpperCAmelCase_       :							int     ,				UpperCAmelCase_       :							int    )				->     DatasetType:

	'''simple docstring'''





	if isinstance(UpperCAmelCase_     ,				UpperCAmelCase_    ):
		return _split_by_node_map_style_dataset(UpperCAmelCase_     ,				rank=UpperCAmelCase_     ,				world_size=UpperCAmelCase_    )
	else:
		return _split_by_node_iterable_dataset(UpperCAmelCase_     ,				rank=UpperCAmelCase_     ,				world_size=UpperCAmelCase_    )





