program yukiNo3002 implicit none integer A, B if (mod(B, 3) .eq. 0) then print *, 0, A else if (mod(B, 3) .eq. 1) then print *, A, 0 else print *, -A, -A end if end program yukiNo3002