import random


def generate_random(residual):
    """
    Helper function for max_min to generate random numbers
    """
    if residual < 0:
        return 0, 0
    first = random.randint(1, 20)
    sec = random.randint(1, 20)
    tot = float(first + sec)
    return (first * residual / tot, sec * residual / tot)