divide and conquer algorithm code in c