In both cases, extremely unlikely. First option would be leaving, carefully, while they are still at a distance. Then I would try all other available options before shooting.
In situations where people have shot at bears, it often did not work anyway.
Chris Trottier (npub1e9x…msz2) ItsDoctorNotMrs 🇨🇦 (npub1c78…7kaz)