Necessary but not sufficient in logic I am working through sample questions and am having a bit of trouble understanding the solution.

Write using logical connectives:

p : Grizzly bears have been seen in the area.

q : Hiking is safe on the trail.

r : Berries are ripe along the trail.

For hiking on the trail to be safe, it is necessary but not
sufficient that berries not be ripe along the trail and
for grizzly bears not to have been seen in the area.

I came up with 

$$q \rightarrow(\lnot r \land \lnot p)$$

However, the solution is

$$q \rightarrow (\lnot r \land \lnot p) \land \lnot((\lnot r\land \lnot p)\rightarrow q)$$

I am wondering why the attached part is required. I guess my problem would be with understanding the question at hand. Would the last two propositions be sufficient enough for the first proposition to be true, are they both together still insufficient? 

Any help is appreciated! Thank you.
For hiking on the trail to be safe, it is necessary but not sufficient that berries not be ripe along the trail and for grizzly bears not to have been seen in the area.


$$(\underbrace{(\lnot r \land \lnot p)\leftarrow q}_{\text{it is neccessary}}) \underbrace{\land}_{\text{and/but}} (\underbrace{\lnot((\lnot r\land \lnot p)\rightarrow q)}_{\text{it is not sufficient}})$$
For hiking on the trail to be safe, it is necessary but not sufficient that berries not be ripe along the trail and for grizzly bears not to have been seen in the area.


This is a bit vague. Do ripe berries on their own really pose a threat to hikers? Or is it the combination of bears and berries that is dangerous?

Unless this is some kind of trick question, I think the author meant: If the berries are ripe along the trail ($r$) and grizzly bears have been seen in the area ($p$), then hiking is not safe on the trail ($\neg q$). (Bears eat berries. Berries alone are seldom dangerous.)

If this is the case, the answer should be:$$r\land p\implies \neg q$$or equivalently  $$q\implies \neg r \lor \neg p$$