Dieta

Problem Link

Solution by augusto100 pts

Code / Notes

#include <bits/stdc++.h>
using namespace std;

int main() {

    int N, M;
    cin >> N >> M;
     int total = 0;

    for (int i = 0; i < N; i++) {
        int P, G, C;
        cin >> P >> G >> C;
          int call = P * 4 + G * 9 + C * 4;
        total += call;
        }
     
     int Sobra= M- total;
     cout<< Sobra<< endl;
}

Last updated 1 month, 4 weeks ago


« Back to problem