M9) Surge multiplier
A ride-hailing app raises its prices when riders wait and few drivers are free. The price of a ride is multiplied by a surge multiplier that depends on the number of waiting ride requests and the number of available drivers in an area. Listing 1 gives the rule.
A tester wrote the test cases in Table 1 before anyone implemented the rule. The expected multiplier of each case should follow from the pseudocode.
| Test | Requests | Drivers | Expected multiplier |
|---|---|---|---|
| T1 | 10 | 5 | 2.0 |
| T2 | 0 | 0 | 3.0 |
| T3 | 5 | 5 | 1.5 |
| T4 | 6 | 5 | 1.5 |