Winner gets more delegates, no matter how close.
According to a document I have from 2008, in South Carolina:
“The GOP allocates on a modified winner-take-all model. The winner of the statewide vote wins all the [3] at-large delegates; the winner in each congressional district gets the delegates for that congressional district.”
That may or may not have changed. I was unable last week to discover a similar document for 2016 listing all the states.