Dieta

Problem Link

Solution by mateusgrl39100 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;
        total += 4*P + 9*G + 4*C;
    }
    cout << M - total << endl;
    // Checar se da negativo -> 0
}

Last updated 1 month, 3 weeks ago


« Back to problem