def calc_new_dimensions(max_size: int, width, height):
    """
    Calculate new minimum dimensions and corresponding scalar
    :param max_size: int
    :param width: int
    :param height: int
    :return: tuple - new dimensions and minimum scalar
    """
    width_scalar = max_size / width
    height_scalar = max_size / height

    best_fit_scalar = min(width_scalar, height_scalar)
    dimensions = (int(width * best_fit_scalar), int(height * best_fit_scalar))
    return dimensions, best_fit_scalar