program main implicit none integer::a,b,answer read *, a,b answer = (b+(a-mod(a,b)))/2 print *, answer end program main