def smallest_square(n: int):
    """
    returns the smallest int square that correspond to a integer
    example: smallest_square(65) returs 8 (8*8 = 64)
    """
    n = abs(n)
    i = 0
    while i**2 <= n:
        i += 1
    if n - (i-1)**2 < i**2 - n:
        return i - 1
    else:
        return i