Your question is Answer Call Center Math. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
During a one-hour interval monitored through Cyara CX Assurance, a call center has x agents. y percent of the agents answer exactly one call each. Of the remaining agents, half answer two calls each and the other half answer no calls.
Implement a function that returns the total number of answered calls. Return -1 when the distribution is impossible because the one-call group is not a whole number of agents or the remaining agents cannot be split equally.
Implement calls_answered(x, y), where x is an integer agent count and y is an integer percentage from 0 through 100. Return an integer representing the total calls answered, or -1 for an invalid distribution. Do not use floating-point arithmetic.
def calls_answered(x, y):