Guest User

TABLET Tester

a guest
Feb 17th, 2019
589
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.47 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. typedef long long ll;
  6. typedef pair<int, int> pii;
  7.  
  8. #define F first
  9. #define S second
  10.  
  11. int main(){
  12.     ios::sync_with_stdio(false);
  13.     cin.tie(0);
  14.     int te; cin >> te;
  15.     while (te--){
  16.         int n, lim;
  17.         cin >> n >> lim;
  18.         int ans = -1;
  19.         while (n--){
  20.             int a, b, c; cin >> a >> b >> c;
  21.             if (c <= lim)
  22.                 ans = max(ans, a*b);
  23.         }
  24.         if (ans == -1)
  25.             cout << "no tablet\n";
  26.         else
  27.             cout << ans << "\n";
  28.     }
  29.     return 0;
  30. }
Add Comment
Please, Sign In to add comment