




'''simple docstring'''







from __future__ import annotations





def 		snake_case_				(_a      :				int	):
    UpperCAmelCase     			=						[0] * max_one

    for i in range(0       ,  _a	):
        UpperCAmelCase     			=						i

    for i in range(2       ,  _a	):
        if totients[i] == i:
            for j in range(_a       ,  _a       ,  _a	):
                totients[j] -= totients[j] // i

    return totients





def 		snake_case_				(_a      :				int       ,  _a      :				int	):
    return sorted(str(_a	)	) == sorted(str(_a	)	)





def 		snake_case_				(_a      :				int = 1_0_0_0_0_0_0_0	):
    UpperCAmelCase     			=						1  # i
    UpperCAmelCase     			=						0  # φ(i)
    UpperCAmelCase     			=						get_totients(max_n + 1	)

    for i in range(2       ,  max_n + 1	):
        UpperCAmelCase     			=						totients[i]

        if i * min_denominator < min_numerator * t and has_same_digits(_a       ,  _a	):
            UpperCAmelCase     			=						i
            UpperCAmelCase     			=						t

    return min_numerator


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










'''simple docstring'''







import json
import os
from dataclasses import dataclass

import numpy as np
import pyarrow as pa

import datasets
from utils import get_duration


A					       =10_00_00_00_00_00
A					       =1_00_00

A       , A					       =os.path.split(__file__)
A					       =os.path.join(RESULTS_BASEPATH, 'results', RESULTS_FILENAME.replace('.py', '.json'))





def 		snake_case_				(_a      :				int       ,  _a      :				int	):
    UpperCAmelCase     			=						pa.Table.from_pydict({'''col''': [0] * chunk_size}	)
    UpperCAmelCase     			=						pa.concat_tables([table] * (num_examples // chunk_size)	)
    return datasets.Dataset(_a       ,  fingerprint='''table_100B'''	)


@dataclass
class      _a    :
       __a							:	int
       __a							:	int
       __a							:	int
       __a							:	int
       def        A (      self		:      List[str]							):



           '''simple docstring'''

           UpperCAmelCase     			=						np.random.default_rng(self.seed							)
           UpperCAmelCase     			=						rng.integers(low=self.low  ,							high=self.high  ,							size=self.size							).tolist()
       def __iter__(      self		:      Tuple							):



           '''simple docstring'''

           return iter(self._sampled_values							)







       def __len__(      self		:      Dict							):



           '''simple docstring'''

           return self.size






@get_duration
def 		snake_case_				(_a      :				datasets.Dataset	):
    UpperCAmelCase     			=						dataset[0]





@get_duration
def 		snake_case_				(_a      :				datasets.Dataset	):
    UpperCAmelCase     			=						dataset[-1]





@get_duration
def 		snake_case_				(_a      :				datasets.Dataset	):
    UpperCAmelCase     			=						dataset[range(len(_a	) // 2       ,  len(_a	) // 2 + 1_0_2_4	)]





@get_duration
def 		snake_case_				(_a      :				datasets.Dataset	):
    UpperCAmelCase     			=						dataset[RandIter(0       ,  len(_a	)       ,  1_0_2_4       ,  seed=4_2	)]





def 		snake_case_				():
    UpperCAmelCase     			=						{'''num examples''': SPEED_TEST_N_EXAMPLES}
    UpperCAmelCase     			=						(get_first_row, get_last_row, get_batch_of_aaaa_rows, get_batch_of_aaaa_random_rows)
    print('''generating dataset'''	)
    UpperCAmelCase     			=						generate_100B_dataset(num_examples=_a       ,  chunk_size=_a	)
    print('''Functions'''	)
    for func in functions:
        print(func.__name__	)
        UpperCAmelCase     			=						func(_a	)

    with open(_a       ,  '''wb'''	) as f:
        f.write(json.dumps(_a	).encode('''utf-8'''	)	)


if __name__ == "__main__":  # useful to run the profiler
   benchmark_table_100B()




