priyam2k

VILLINE

Jan 11th, 2020
368
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.68 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2.  
  3. using namespace std;
  4. using ll = long long;
  5.  
  6. #define mp make_pair
  7. #define pb push_back
  8. #define eb emplace_back
  9.  
  10. void io(){
  11.     ios_base::sync_with_stdio(false);
  12.     cin.tie(NULL);
  13.     cout.tie(NULL);    
  14. }
  15. const int N = 2e5 + 5;
  16.  
  17. ll f[2];
  18.  
  19. int main() {
  20.     io();
  21.     ll n,m,c;
  22.     cin>>n>>m>>c;
  23.     ll pos=0,neg=0;
  24.     for(int i=0;i<n;i++){
  25.         ll x,y,p;
  26.         cin >> x >> y >> p;
  27.         ll g = y - 1LL*x*m - c;
  28.         assert(g != 0);
  29.         if(g > 0){
  30.             f[1]++;
  31.             pos += p;
  32.         }
  33.         else{
  34.             f[0]++;
  35.             neg += p;
  36.         }
  37.     }
  38.     cout<<max(pos,neg)<<endl;
  39.    
  40. }
Add Comment
Please, Sign In to add comment