Plz tell my mistake Only one test case is passed other failed

#include
#include
using namespace std;
int main()
{
long long int a;
cin>>a;
long long int arr[a];
for(int i=0;i<a;i++)
cin>>arr[i];
long long int test;
cin>>test;
for(int i=0;i<test;i++)
{
long long int n;
cin>>n;
long long int *idx=lower_bound(arr,arr+a,n);
long long int d=idx-arr;
if(d==a)
cout<<-1<<" “;
else cout<<d<<” ";
idx=upper_bound(arr,arr+a,n);
long long int e=idx-arr;
if(e==a)
cout<<-1<<endl;
else cout<<e-1<<endl;
}
}

Please save your code on ide.codingblocks.com and then share its link.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.