from concurrent.futures import InterpreterPoolExecutor
from time import perf_counter as T


def work(n):
    s = 0
    for i in range(n):
        s += (i * i) % 97
    return s


N = 20_000_000
nworkers = 4

t0 = T()

with InterpreterPoolExecutor(max_workers=nworkers) as ex:
    results = list(ex.map(work, [N] * nworkers))

print(f"time = {(T() - t0):.3f} seconds")
print(results)
