program report
implicit none
real(8) :: x, y, x1, y1, x2, y2, HX, e
integer :: i
read *, x, y
e = 0.0000001
do i = 1, 100000
HX = fx(x)*gy(x,y) - fy(y)*gx(x,y)
x1 = x - (f1(x,y)*gy(x,y) - fy(y)*g1(x,y))/HX
y1 = y - (-f1(x,y)*gx(x,y) + fx(x)*g1(x,y))/HX
x2 = x1 - x
x2 = abs(x2)
y2 = y1 -y
y2 = abs(y2)
if (x2 < e) then
if (y2 < e) exit
end if
x = x1
y = y1
end do
write(*,*) x, y, x2, y2
contains
!関数定義
function f1(x, y)
real(8) :: f1
real(8), intent(in) :: x, y
f1 = x**2 + y**2 - 1
end function f1
function g1(x,y)
real(8) :: g1
real(8), intent(in) :: x, y
g1 = (X**2)*(2 + x) - (y**2)*(2 - x)
end function g1
function fx(x)
real(8) :: fx
real(8), intent(in) :: x
fx = 2*x
end function
function fy(y)
real(8) :: fy
real(8), intent(in) :: y
fy = 2*y
end function
function gx(x,y)
real(8) :: gx
real(8), intent(in) :: x, y
gx = 3*(x**3) + 4*x + y**2
end function
function gy(x,y)
real(8) :: gy
real(8), intent(in) :: x, y
gy = -4 *y +(2*x)*y
end function
end program report
cHJvZ3JhbSByZXBvcnQKICAgIGltcGxpY2l0IG5vbmUgCiAgICByZWFsKDgpIDo6IHgsIHksIHgxLCB5MSwgeDIsIHkyLCBIWCwgZSAgCiAgICBpbnRlZ2VyIDo6IGkgCiAgICByZWFkICosIHgsIHkgCiAgICBlID0gMC4wMDAwMDAxIAogCiAgICBkbyBpID0gMSwgMTAwMDAwIAogICAgICBIWCA9IGZ4KHgpKmd5KHgseSkgLSBmeSh5KSpneCh4LHkpICAKICAgICAgeDEgPSB4IC0gKGYxKHgseSkqZ3koeCx5KSAtIGZ5KHkpKmcxKHgseSkpL0hYIAogICAgICB5MSA9IHkgLSAoLWYxKHgseSkqZ3goeCx5KSArIGZ4KHgpKmcxKHgseSkpL0hYIAogICAgICAgCiAgICAgIHgyID0geDEgLSB4IAogICAgICB4MiA9IGFicyh4MikgCiAgICAgIHkyID0geTEgLXkgCiAgICAgIHkyID0gYWJzKHkyKSAKIAogICAgICBpZiAoeDIgPCBlKSB0aGVuIAogICAgICAgIGlmICh5MiA8IGUpIGV4aXQgCiAgICAgIGVuZCBpZiAgCiAKICAgICAgeCA9IHgxIAogICAgICB5ID0geTEgCiAgICBlbmQgZG8gCiAgICAgCiAgICAgICB3cml0ZSgqLCopIHgsIHksIHgyLCB5MiAKICAgIAogICAgY29udGFpbnMKIAogICAgIemWouaVsOWumue+qQogICAgZnVuY3Rpb24gZjEoeCwgeSkgCiAgICAgIHJlYWwoOCkgOjogZjEgIAogICAgICByZWFsKDgpLCBpbnRlbnQoaW4pIDo6IHgsIHkgCiAgICAgIGYxID0geCoqMiArIHkqKjIgLSAxIAogICAgZW5kIGZ1bmN0aW9uIGYxIAogCiAgICBmdW5jdGlvbiBnMSh4LHkpIAogICAgICByZWFsKDgpIDo6IGcxIAogICAgICByZWFsKDgpLCBpbnRlbnQoaW4pIDo6IHgsIHkgCiAgICAgIGcxID0gKFgqKjIpKigyICsgeCkgLSAoeSoqMikqKDIgLSB4KSAKICAgIGVuZCBmdW5jdGlvbiBnMSAKIAogICAgZnVuY3Rpb24gZngoeCkgCiAgICAgcmVhbCg4KSA6OiBmeCAKICAgICByZWFsKDgpLCBpbnRlbnQoaW4pIDo6IHggCiAgICAgZnggPSAyKnggCiAgICBlbmQgZnVuY3Rpb24KICAgIAogICAgZnVuY3Rpb24gZnkoeSkgCiAgICAgIHJlYWwoOCkgOjogZnkgCiAgICAgIHJlYWwoOCksIGludGVudChpbikgOjogeSAKICAgICAgZnkgPSAyKnkgCiAgICBlbmQgZnVuY3Rpb24gCiAKICAgIGZ1bmN0aW9uIGd4KHgseSkgCiAgICAgcmVhbCg4KSA6OiBneCAKICAgICByZWFsKDgpLCBpbnRlbnQoaW4pIDo6IHgsIHkgCiAgICAgZ3ggPSAzKih4KiozKSArIDQqeCArIHkqKjIgCiAgICBlbmQgZnVuY3Rpb24gCiAKICAgIGZ1bmN0aW9uIGd5KHgseSkgCiAgICAgcmVhbCg4KSA6OiBneSAKICAgICByZWFsKDgpLCBpbnRlbnQoaW4pIDo6IHgsIHkgCiAgICAgZ3kgPSAtNCAqeSArKDIqeCkqeSAKICAgIGVuZCBmdW5jdGlvbiAKIAplbmQgcHJvZ3JhbSByZXBvcnQK