int* divingBoard(int shorter, int longer, int k, int* returnSize){ int val=longer-shorter,i; *returnSize=0; int* arr=(int*)calloc(k+1,sizeof(int)); if(k==0) return arr; arr[(*returnSize)++]=shorter*k; if(shorter==longer) return arr; for(i=1; i<k+1; i++) arr[(*returnSize)++]=arr[i-1]+val; return arr; }