Dieta

Problem Link

Solution by dudu100 pts

Code / Notes

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

int main() {
    int N, M;
    cin >> N >> M;

    int full = 0;
    for (int i = 0; i < N; i++) {
        int P, G, C;
        cin >> P >> G >> C;

        int total = P * 4 + G * 9 + C * 4;
        full += total;
    }
    int left = M - full;
    cout << max(0, left) << endl;
}

Last updated 7 hours, 21 minutes ago


« Back to problem