Help me in solving TABLET problem

My issue

example input are giving right ans while on submission it shows wrong. plz help to know which cases are giving wrong result

My code

#include <stdio.h>

int main(void) {
	int t,n,b;
	scanf("%d",&t);
	for(int i=0; i<t ; i++){
	    scanf("%d",&n);
	    scanf("%d",&b);
	    int arr[n];
	    int p[n],h,w,area[n];
	    int l=0;
	    for(int j=0; j<n; j++){
	        scanf("%d",&w);
	        scanf("%d",&h);
	        scanf("%d",&p[j]);
	        area[j]=0;
	        if(p[j]>b){ 
	            l++;
	            continue;
	        }
	        area[j]=h*w;
	    }
	    if(l==n){
	        printf("no tablet\n");
	        continue;
	    }
	    int hr=0;
	    int ha = area[0];
	    for(int k=1;k<n;k++){
	       
	        if(area[k]>ha){
	            hr = k;
	        }
	    }
	    printf("%d\n",area[hr]);
	} 

}


Problem Link: Buying New Tablet Practice Coding Problem - CodeChef

@vrsabu
plzz refer my c++ code for better understanding of the logic

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

int main() {
	// your code goes here
    int t;
    cin>>t;
    while(t--)
    {
        int n,b;
        cin>>n>>b;
        int ans=-1;
        while(n--)
        {
            int w,h,c;
            cin>>w>>h>>c;
            if(c<=b)
            {
                ans=max(ans,w*h);
            }
        }
        if(ans==-1)
        cout<<"no tablet";
        else
        cout<<ans;
        cout<<endl;
    }
}