divide and conquer algorithm program in c