Your first two tests add up to:
85 + 89 = 174
To average 87 for 3 tests, the tests need to add up to : 87 x 3 = 261
To average 91, the 3 tests need to equal: 91 x 3 = 273
So to average 87, the third test needs to be: 261 - 174 = 87
To average 91, the third test needs to be: 273 - 174 = 99
Your score needs to be between 87 and 99