So, use IP's original idea, but tack back on the extra $10 mil to the Mavs' payroll to keep Pierce.
Puts them at around $40 mil, before they do anything with Beaubois and Collison (combined cap hold of $11.5 mil).
I think the Mavs would prefer to keep Cunningham as a cheap contract. Add $1.2 mil back.
Let's assume they let Roddy B walk, but keep Collison: add $5.8 mil cap hold.
Mavs would stand at $47 mil with a roster of Collison, Cunningham, Pierce, Dirk, B James, and Crowder.
There'd be cap holds for exceptions to figure in as well, I think. I'm not sure there'd be enough space to absorb KG's $12.5 mil outright. Might need to be some additional gymnastics by Dallas to pull it off. Maybe they could use Collison in a S&T for KG, and then hope to somehow land a PG at veteran min level (Billups?)?
PG: Billups
SG: Cunningham
SF: Pierce, Crowder
PF: Dirk
C: KG, James
Razor-thin roster. Needs a combo guard and at least one other big who can be relied upon for 20 minutes a night.