read A B rem=$((A % B)) if [ "$rem" -eq 0 ]; then ans=$((A + B)) else ans=$((A + (B - rem))) fi echo "$ans"