wx is the cost of the cab ride.
We want the equation to be z = (equation)
To divide cost evenly between friends, divide wx by y.
Your final equation is
z = wx/y
Note: If Carlos doesn't count as a friend, the equation might be z = wx/(y+1)
Have an awesome day! :)