Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- using ll = long long;
- #define mp make_pair
- #define pb push_back
- #define eb emplace_back
- void io(){
- ios_base::sync_with_stdio(false);
- cin.tie(NULL);
- cout.tie(NULL);
- }
- const int N = 2e5 + 5;
- ll f[2];
- int main() {
- io();
- ll n,m,c;
- cin>>n>>m>>c;
- ll pos=0,neg=0;
- for(int i=0;i<n;i++){
- ll x,y,p;
- cin >> x >> y >> p;
- ll g = y - 1LL*x*m - c;
- assert(g != 0);
- if(g > 0){
- f[1]++;
- pos += p;
- }
- else{
- f[0]++;
- neg += p;
- }
- }
- cout<<max(pos,neg)<<endl;
- }
Add Comment
Please, Sign In to add comment