#include <stdio.h>

#include<stdlib.h>

int main(){

int number_of_test_cases,number_of_baskets,number_of_fruits,min,index;

scanf("%d",&number_of_test_cases);

for(int i=0;i<number_of_test_cases;i++){

scanf("%d %d",&number_of_baskets,&number_of_fruits);

int* type = malloc(number_of_baskets*sizeof(int));
int* price = malloc(number_of_baskets

*sizeof(int));*

inta = malloc(number_of_fruits*sizeof(int));

int

for(int k=0;k<number_of_baskets;k++){

scanf("%d",&type[k]);

}

for(int k=0;k<number_of_baskets;k++){

```
scanf("%d",&price[k]);
}
for(int k=0;k<number_of_fruits;k++){
a[k]=0;
}
for(int k=0;k<number_of_baskets;k++){
//index = type[k] - 1;
a[(type[k]-1)]+=price[k];
}
for(int k=0;k<number_of_fruits;k++){
if(a[k]>0){
min=a[k];
break;
}
}
for(int k=1;k<number_of_fruits;k++){
if(a[k]<min&&a[k]!=0)
min=a[k];
}
printf("%d\n",min);
}
return 0;
```

}

Given above is my code for CHPINTU for MARCH20B contest. It is displaying wrong answer after submitting it. But I am not able to figure out where it is going wrong as it is giving the test case answer correctly along with some more cases that I thought of.

So could somebody tell me what is the error?