Help me in solving S10E problem

My issue

HELP ME IN SOLVING S10E
what is wrong with this code

My code


 #include <stdio.h>
int main(void) {
	// your code goes here
	int t;scanf("%d",&t);
    while(t--){
        int n;scanf("%d",&n);
        int a[n],c=1;
        for(int i=1;i<=n;i++){
              scanf("%d",&a[i]);}
        for(int i=6;i<=n;i++){
            int f=1;
            for(int j=1;j<=5;j++){
                if(a[i]>a[i-j]){
                    f=0;
                    break;}}
            if(f==1) c++;}
        int min=a[1];
        for(int i=1;i<=5;i++){
            if(a[i]<min){min






Problem Link: Phone Prices Practice Coding Problem - CodeChef

@vaishnavi_5779
plzz refer the following c code

#include <stdio.h>

int main(void) {
    int t;
    scanf("%d",&t);
    while(t--){
        int n;
        scanf("%d",&n);
        int a[n];
        for(int i=0;i<n;i++){
            scanf("%d",&a[i]);
        }
        int p=1;
        for(int i=5;i<n;i++){
          if(a[i]<a[i-1]&&a[i]<a[i-2]&&a[i]<a[i-3]&&a[i]<a[i-4]&&a[i]<a[i-5]){
          p++;
        }
      }
       if(a[1]<a[0])  p++;
       if(a[2]<a[1]&&a[2]<a[0]) p++;
       if(a[3]<a[2]&&a[3]<a[1]&&a[3]<a[0])  p++;
       if(a[4]<a[3]&&a[4]<a[2]&&a[4]<a[1]&&a[4]<a[0])  p++;
       
       printf("%d\n",p);
    }
	return 0;
}

I understood the code you sent but could you help me to find the mistake in my code