How to calculate what I need to get on my Midterm in order to keep my B

I have an 84.9 percent in my AP World History Class and I have a midterm that is worth 100 points which is placed into my Tests category. I have the following categories:

Tests - Weighted as 50% of my grade

Homework - Weighted as 30% of my grade

Reading/Listening Quizzes - Weighted as 20% percent of my grade

Now, I was wondering what I need to get on the midterm in order to maintain my B. Now I can take it as low as 80.00% but no lower.

The Current amount of points I have in each category is the following:

Tests - 294.6 / 365

Homework - 158 / 167

Reading/Listening Quizzes - 124 / 153

Also, my midterm is tomorrow, so the sooner the responses the better!

Thanks in advance!! (Happy)