-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathTABLET.cpp
More file actions
50 lines (37 loc) · 993 Bytes
/
TABLET.cpp
File metadata and controls
50 lines (37 loc) · 993 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#include<bits/stdc++.h>
using namespace std;
typedef long long int lli;
typedef long double ld;
#define FOR(a,b) for(auto i=a;i<b;i++)
#define FAIO ios_base::sync_with_stdio(false); cin.tie(NULL);
#define test_cases int T;cin>>T;while(T--)
int main(){
FAIO
int N,B,W,H,P,Area;
test_cases{
cin>>N>>B;
pair<int,int> TabletAreaPrice[N];
for(int i=0;i<N;i++){
cin>>W>>H>>P;
Area=W*H;
TabletAreaPrice[i].first=Area;
TabletAreaPrice[i].second=P;
}
sort(TabletAreaPrice,TabletAreaPrice+N);
bool flag=true;
for(int i=N-1;i>=0;i--){
if(TabletAreaPrice[i].second<=B){
flag=false;cout<<TabletAreaPrice[i].first<<endl;break;
}
}
if(flag){
cout<<"no tablet"<<endl;
}
}
return 0;
}
/*
You can always say me thanks
Autthor: SONUKUMARSAW
email: sonukumarsaw66@gmail.com
*/