program main implicit none integer*8::N,i,Z real*8::A,B,C,log10,XY real*8,allocatable::AB(:,:) read *,N allocate(AB(2,N)) read *,AB log10 = log(10.0_8) do i=1,N A = AB(1,i) B = AB(2,i) C = B*log(A)/log10 Z = C XY = 10**(C-DBLE(Z)) print '(i0," ",i0," ",i0)',IDINT(XY),IDINT((XY-DINT(XY))*10),Z end do end program main