def get_max_time(canvas_size, t_offset):
    """Get the maximum number of reasonable time steps for a given ToySquares instance, until which not many objects will have fallen off the canvas

    Parameters
    ----------
    canvas_size : int
        size of the canvas on which the toy squares fall, in pixels
    t_offset : int
        number of time steps between X and Y

    """
    max_time = int(canvas_size/2)
    max_time = 2*(max_time//2) + 2 # round to nearest even number
    if (max_time == 1) or (max_time < t_offset):
        raise ValueError("Value supplied for t_offset is too high compared to the canvas size.")
    return max_time