# Pizza Delivery

**URL:** <https://discuss.codechef.com/t/pizza-delivery/61063>\
**Category:** help\
**Tags:** c-plus-plus\
**Created:** [April 9, 2020, 8:55am UTC](https://discuss.codechef.com/t/pizza-delivery/61063 "2020-04-09T08:55:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![agarwaltanmay](https://www.codechef.com/sites/all/themes/abessive/images/user_default_thumb.jpg) [@agarwaltanmay](https://discuss.codechef.com/u/agarwaltanmay)\
**Post date:** [April 9, 2020, 8:55am UTC](https://discuss.codechef.com/t/pizza-delivery/61063/1 "2020-04-09T08:55:38Z")

</div>

I wrote the code for this problem [DBOY Problem - CodeChef](https://www.codechef.com/problems/DBOY) (Pizza Delivery). But the problem is that I am getting WA but it is passing the all test cases. Maybe I have left some edge test cases untouched. Pls help me to get those test cases. Thanks in advance 😀

#include \<bits/stdc++.h\>  
using namespace std;

int main() {  
// your code goes here  
int t;  
cin\>\>t;  
while(t–){  
int i,n,left = 0,count = 0, innercount;  
cin\>\>n;  
int \*dilevery = new int[n];  
int \*station = new int[n];  
for(i = 0; i\<n; i++){  
cin\>\>dilevery[i];  
dilevery[i] \*=2;  
}  
for(i = 0; i\<n; i++)  
cin\>\>station[i];  
for(i = 0; i\<n; i++){  
innercount = 0;  
int dil = dilevery[i];  
int inc = station[i];  
if(dilevery[i] \<= left){  
left = left - dilevery[i];  
continue;  
}  
dilevery[i] = dilevery[i] - left;  
while(dilevery[i] \> 0){  
dilevery[i] = dilevery[i] - station[i];  
if(innercount \> 0)  
station[i] = station[i] + inc;  
innercount++;  
count++;  
}  
left = station[i] - dil;  
}  
cout\<\<count\<\<endl;  
delete [] dilevery;  
delete [] station;  
}  
return 0;  
}
