Subarray Division Hackerrank Solution In C