Fast-Track a New Group Member
Context
A community platform wants to estimate how many outreach actions are needed to bring a user into a private group. Each action can advance the user's progress by exactly one of two fixed trust boosts. The user is considered ready once total progress reaches or passes the required threshold. Find the fewest actions needed.
Problem
Implement a function that returns the minimum number of outreach actions needed to reach or pass a target progress value. Every action contributes either boost_a or boost_b progress points, and the same boost may be used repeatedly. If the target is zero, no actions are needed. Otherwise, choose the better displacement whenever possible and count enough actions to meet or exceed the target. The result must be an integer and must use exact integer arithmetic.
Examples
boost_a = 5boost_b = 8target = 00boost_a = 6boost_b = 10target = 71boost_a = 4boost_b = 7target = 203Constraints
1 <= boost_a <= 10000000001 <= boost_b <= 10000000000 <= target <= 1000000000- Types:
boost_ais int,boost_bis int,targetis int; result is int
Function signature
def minimum_outreach_actions(boost_a: int, boost_b: int, target: int) -> int
boost_aint- Progress points added by the first kind of outreach action.
boost_bint- Progress points added by the second kind of outreach action.
targetint- Nonnegative progress threshold required for group readiness.
- returns int
- The smallest number of actions whose total progress reaches or exceeds target.
Adapted from MBPP problem task_617 (CC BY 4.0). Rewritten, extended and verified by Iksha.
Notes
- The two boosts may be equal.
- An action may overshoot the target; overshooting still counts as reaching it.