def nearest_x(num, x):
    """ Returns the number rounded down to the nearest 'x'.
    example: nearest_x(25, 20) returns 20. """
    for i in range(x):
        if not (num - i) % x:
            return num - i