Alerting on 2 different queries

Hi , I’m trying to get alerting on two different queries. The difference should be adressed in percentage and alerting when a certain percentage has been reached.
Query A: sum by (datacenter,pathTemplate) (increase(api_response_time_seconds_count{job =~ “api”, datacenter=~ “A.", httpStatusCode =~ "2.”,pathTemplate=“/…/…/…/A”}[5m])>0)
Query B: sum by (datacenter,pathTemplate) (increase(api_response_time_seconds_count{job =~ “api”, datacenter=~ “B.", httpStatusCode =~ "2.”,pathTemplate=“/…/…/…/B”}[5m])>0)

If the result of query A (at a certain time) is 100 and query B (same timeframe) is 60, percentage will be 40. An alert should be triggered at that level. Is this possible ? And if so, how ?