import os
import random

def generate_files(count):
    directory = "/var/data/"
    if not os.path.exists(directory):
        os.makedirs(directory)

    for _ in range(count):
        file_name = f"{directory}file_{random.randint(1, 10)}.txt"

        with open(file_name, 'w') as f:
            for _ in range(random.randint(1, 100)):
                f.write(f"{random.randint(1, 100)}\n")

        print(f"Сгенерирован файл {file_name}")


def generate_data():
    
    file_name = "/var/data/data.txt"

    with open(file_name, 'w') as f:
        for _ in range(random.randint(10, 100)):
            f.write(f"{random.randint(1, 30)}\n")
    print(f"Сгенерирован файл {file_name}")


if __name__ == "__main__":
    generate_files(10)
    generate_data()
    

