Boat B should have used its starboard tack status to its advantage earlier (before the zone) or jibed and used its leeward status to its advantage earlier. Once in the zone, the inside boat gets mark room:
18.1 When Rule 18 Applies
Rule 18 applies between boats when they are required to leave a mark on the same side and at least one of them is in the zone. However, it does not apply
(a) between boats on opposite tacks on a beat to windward,
(b) between boats on opposite tacks when the proper course at the mark for one but not both of them is to tack,
(c) between a boat approaching a mark and one leaving it, or
(d) if the mark is a continuing obstruction, in which case rule 19 applies.
18.2 Giving Mark-Room
(a) When boats are overlapped the outside boat shall give the inside boat mark-room, unless rule 18.2(b) applies.
(b) If boats are overlapped when the first of them reaches the zone, the outside boat at that moment shall thereafter give the inside boat mark-room. If a boat is clear ahead when she reaches the zone, the boat clear astern at that moment shall thereafter give her mark-room.
(c) When a boat is required to give mark-room by rule 18.2(b), she shall continue to do so even if later an overlap is broken or a new overlap begins. However, if the boat entitled to mark-room passes head to wind or leaves the zone, rule 18.2(b) ceases to apply.
(d) If there is reasonable doubt that a boat obtained or broke an overlap in time, it shall be presumed that she did not.
(e) If a boat obtained an inside overlap from clear astern and, from the time the overlap began, the outside boat has been unable to give mark-room, she is not required to give it.