CLLCM (coder's legacy)

what’s wrong with my code??
I used the logic if even num present print no else yes

#include<iostream>
using namespace std;
int main()
{
    int t;
    cin>>t;
    for(int i=1;i<=t;i++)
    {
        int n,f=0;
        cin>>n;
        int arr[n];

        for(int j=0;j<n;j++)
        cin>>arr[j];

        for(int j=0;j<n;j++)
        {
        if(arr[j]%2==0)
        {
            cout<<"NO"<<endl;
            f=1;
            break;
        }
        }
        if(f==0)
        cout<<"YES";
    }
}

U need to print answer on a new line every time. So just add cout << “YES” << “\n” on the last lie :slight_smile: