def maxsteps(value, maxval=500):
    """
    Returns the maximum number of steps and stepsize for a value that may be
    divided up to a maximum value, all being rounded value. For example, if one
    wants to get the maximum number of steps to get to a value of 100 where it
    can be maximally divided 7 times, it will return nsteps=5, stepsize=20.
    """
    valrange = [value - 3, value - 2, value - 1, value]
    nsteps = 1
    for val in valrange:
        for _, n in enumerate(reversed(list(range(1, maxval)))):
            if val % n == 0:
                if n > nsteps:
                    nsteps = int(n)
                    stepsize = int(val / nsteps)
                break
    return nsteps, stepsize
