import math


def squaredims(n):
    """Given an integer, calculate the factorization n = a * b, where |a - b| <= 2, a <= b
    >>> squaredims(100)
    (10, 10)
    """
    a = math.floor(math.sqrt(n))
    b = math.ceil(n / a)
    return a, b