program main implicit none integer(8) l,k read(*,*)l,k if(mod(l,2*k)/=0)l=l-mod(l,2*k) write(*,*)l/2 end program main