#include<bits/stdc++.h>

using namespace std;

int main(void)

{

int t,i,j,count;

float atd,q,n;

char a[1000];

cin>>t;

while(t–)

{

q=i=j=count=0;

cin>>n;

cin>>a;

for(i=0;i<n;i++)

{

if (a[i]==‘P’)

q++;

}

atd=q/n;

for(j=2;j<n-2;j++)

{

if(a[j]==‘A’&& (a[j+1]==‘P’||a[j+2]==‘P’ )&&(a[j-1]==‘P’||a[j-2]==‘P’))

{ q++;

count++;

atd=q/n;

}

if (atd>=0.75)

break;

else

continue;

}

if(atd<0.75)

cout<<"-1"<<"\n";

else

cout<<count<<"\n";

}

```
// your code goes here
return 0;
```

}

PLEASE TELL ME WHY AM I GETTING WA