Am i missing any test case?

link of the code

#include <bits/stdc++.h>
using namespace std;

int main()
{
//write your code here
int t;
cin>>t;
while(t–)
{
int n,d=0,g=1;
cin>>n;
int a[n];
for(int i=0;i<n;i++)
{
cin>>a[i];
}
for(int i=0;i<n;i++)
{
for(int j=i+1;j<n;j++)
{
for(int k=j+1;k<n;k++)
{
int x=a[i]*a[i],y=a[j]*a[j],z=a[k]*a[k];
if(x==y+z||y==x+z||z==x+y)
{
// cout<<x/a[i]<<" “<<y/a[j]<<” “<<z/a[k]<<” "<<endl;
if(g–){
cout<<“Yes”<<endl;
d+=1;
break;
}
}
}
}
}
if(d==0)
{
cout<<“No”<<endl;
}
}
return 0;
}

Please format your code - the forum software has mangled it and it won’t compile! :slight_smile:

1 Like

i am unable to get you sir

https://pastebin.com/qbxYqxr1

1 Like

Thanks, but that has all the forum-mangling from the original post and won’t compile :slight_smile:

#include <bits/stdc++.h>
using namespace std;

int main()
{
  //write your code here
  int t;
  cin>>t;
  while(t--)
  {
    int n,d=0,g=1;
    cin>>n;
    int a[n];
    for(int i=0;i<n;i++)
    {
      cin>>a[i];
    }
    for(int i=0;i<n;i++)
    {
      for(int j=i+1;j<n;j++)
      {
        for(int k=j+1;k<n;k++)
        {
        int   x=a[i]*a[i],y=a[j]*a[j],z=a[k]*a[k];
        if(x==y+z||y==x+z||z==x+y)
        {
         // cout<<x/a[i]<<" "<<y/a[j]<<" "<<z/a[k]<<" "<<endl;
         if(g--){
          cout<<"Yes"<<endl;
          d+=1;
          break;
         }
        }
        }
      }
    }
    if(d==0)
    {
      cout<<"No"<<endl;
    }
  }
  return 0;
}