Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main() {
- int N, A, C;
- scanf("%d",N);
- scanf("%d",A);
- scanf("%d",C);
- for (i=0;i<N;i++) {
- scanf("%d",t);
- scanf("%d",r);
- scanf("%d",m);
- if(m>2*t*C) and (A>=r) {
- A+=m;
- A-=2*t*C;
- }
- }
- printf("%d",A);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement