Help me in solving HLEQN problem

My issue

how to solve

My code

#include <stdio.h>

int main() {
    int t;
    scanf("%d",&t);
    while(t--){
        int num,found=0;
        scanf("%d",&num);
        for(int j=1;j<=num;j++){
            int i=(num-2*j)/(2+j);
            if(i>0 && 2*i+2*j+i*j==num){
                found=1;
                break;
            }
        }
        if(found){
            printf("YES\n");
        }
        else{
            printf("NO\n");
        }
    }
    return 0;
}


Learning course: Roadmap to 3*
Problem Link: https://www.codechef.com/learn/course/klu-roadmap-3star/KLURMP302/problems/HLEQN