Deductions & credits

Bargain sales to charity. 

A bargain sale of property to a charitable organization is partly a sale or exchange and partly a charitable contribution. If a charitable deduction for the contribution is allowable, you must allocate your adjusted basis in the property between the part sold and the part contributed based on the fair market value of each. 

https://www.irs.gov/publications/p544

View solution in original post