﻿from math import*
def val_app (n,p):
    u=n
    while u-sqrt(n)>p:
        u=(1/2)*(u+n/u)
    return u