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