
"""simple docstring"""



def 					lowerCamelCase   (     _snake_case ):
    UpperCAmelCase__	:      List[str]     							=					[0] * len(_snake_case )

    for i in range(1    ,len(_snake_case ) ):
        # use last results for better performance - dynamic programming
        UpperCAmelCase__	:      Optional[int]     							=					prefix_result[i - 1]
        while j > 0 and input_string[i] != input_string[j]:
            UpperCAmelCase__	:      Union[str, Any]     							=					prefix_result[j - 1]

        if input_string[i] == input_string[j]:
            j += 1
        UpperCAmelCase__	:      Optional[int]     							=					j

    return prefix_result
def 					lowerCamelCase   (     _snake_case ):
    return max(prefix_function(_snake_case ) )


if __name__ == "__main__":
    import doctest

    doctest.testmod()



"""simple docstring"""



from itertools import permutations
def 					lowerCamelCase   (     _snake_case ):
    if num[3] % 2 != 0:
        return False

    if (num[2] + num[3] + num[4]) % 3 != 0:
        return False

    if num[5] % 5 != 0:
        return False

    UpperCAmelCase__	:      List[str]     							=					[7, 11, 13, 17]
    for i, test in enumerate(_snake_case ):
        if (num[i + 4] * 100 + num[i + 5] * 10 + num[i + 6]) % test != 0:
            return False
    return True
def 					lowerCamelCase   (     _snake_case = 10 ):
    return sum(
        int(''.join(map(_snake_case    ,_snake_case ) ) )
        for num in permutations(range(_snake_case ) )
        if is_substring_divisible(_snake_case ) )


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

