Codeforces celebrates 10 years! We are pleased to announce the crowdfunding-campaign. Congratulate us by the link https://codeforces.com/10years. ×

### nishanth.molleti9's blog

By nishanth.molleti9, history, 8 months ago, ,

Below is my code to the problem named taxi . I will also attach the link of the problem . Let me know where does my code break. https://codeforces.com/problemset/problem/158/B

my code in C language :-

# include<stdio.h>

main() { float c; int n, a[100],i ,sum=0 ,d,e=0,f=0; scanf("%d",&n); if(1<n<100000) {

for(i=0;i<n;i++)
scanf("%d",&a[i]);
for(i=0;i<n;i++)
{
sum=sum+a[i];

}

// printf("%d\n",sum); c=sum/4; // printf("%f",c); d= fmod(sum,4); //printf("%d\n",d); if(d != 0) { e=c+1; printf("%d",e); } else if(d == 0) { f=c; printf("%d",f); } }

}

• -16

 » 8 months ago, # |   0 I will also attach the link of the problemThe codeforces community is so thankful to you
 » 8 months ago, # |   +8 ~~~~~Your code here...~~~~~Can you add this next time when you plan to share your code? What you share is unreadable and I have to check your submission history.About your solution: clearly the idea of your solution doesn't work as shown in the test case. For the case of 3 3 2, you cannot use 2 taxi as the first 2 groups will occupy 3 of 2 taxis, and the last group cannot fit in any of them as they are required to stay together.