Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int a,b,c,d,e;
- int x[2010];
- int finn, maxx;
- int main()
- {
- scanf("%d",&a);
- for(int i=0;i<a;i++){
- scanf("%d %d %d",&b,&c,&d);
- for(int j=b;j<(b+c);j++){
- x[j] += d;
- }
- }
- for(int i=0;i<2010;i++){
- maxx = max(maxx, x[i]);
- }
- printf("%d",maxx);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement