Advertisement
Guest User

Untitled

a guest
Dec 13th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int a,b,c,d,e;
  5. int x[2010];
  6. int finn, maxx;
  7.  
  8.  
  9. int main()
  10. {
  11. scanf("%d",&a);
  12.  
  13. for(int i=0;i<a;i++){
  14. scanf("%d %d %d",&b,&c,&d);
  15. for(int j=b;j<(b+c);j++){
  16. x[j] += d;
  17. }
  18. }
  19.  
  20. for(int i=0;i<2010;i++){
  21. maxx = max(maxx, x[i]);
  22. }
  23.  
  24. printf("%d",maxx);
  25.  
  26. return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement