program main implicit none integer::AA,BB integer::a,b,i,j,upper,lower read *,AA,BB do i=1,200 upper = INT((i*(AA))/100.0) lower = INT((i*(AA+1))/100.0) do j = upper, lower a = INT(( (j*1.0)/i)*100+0.501) b = INT((1.0*(i-j)/i)*100+0.501) if( a.eq.AA .and. b.eq.BB) then print '(i0)',i return end if end do end do end program main