Why we are doing this?

max = inc[0] + dec[0] - 1;
for (int i = 1; i < n; i++)
if (inc[i] + dec[i] - 1 > max)
max = inc[i] + dec[i] - 1;

instead of that why we cant find max in INC and max in DEC and the (Max in INC+Max in DEC - 1) ?

@premang we have to find a k which can divide the subarray in inc and dec parts means left of this point k should be in increasing order and right should be in decreasing order,it means that point k will be same for inc and dec array hence we should take max taking same point i and calculating sum of its inc[i]+dec[i] if we calculate both max separately there maybe chances of existing two different k for same subarray which will be invalid.

still my code is not working can you send me the code.
it only passes 4th test case.

i have updated your code look at this (https://ide.codingblocks.com/s/212453).