void closestSum(int arr[], int n, int t){ int prev=0; int post=0; int curSum=arr[0]; int resPrev, resPost; int closeSum=arr[0]; while(1){ if(curSum==t){ resPrev=prev; resPost=post; break; } else if(curSumif(prev==n-1) break; else{ prev++; curSum+=arr[prev]; } } else{ curSum-=arr[post++]; } if(abs(curSum-t)closeSum=curSum; } cout<}