Advertisement
Guest User

Untitled

a guest
Sep 18th, 2019
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. #include <stdio.h>
  2. int main() {
  3. int N, A, C;
  4. scanf("%d",N);
  5. scanf("%d",A);
  6. scanf("%d",C);
  7. for (i=0;i<N;i++) {
  8. scanf("%d",t);
  9. scanf("%d",r);
  10. scanf("%d",m);
  11. if(m>2*t*C) and (A>=r) {
  12. A+=m;
  13. A-=2*t*C;
  14. }
  15. }
  16. printf("%d",A);
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement