Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int n, x , y , p;
- cin >> n >> x >> y >> p;
- if(p == 1)
- {
- int u=0, c=0;
- for(int i = 1 ; i <= n; ++i)
- cin >> x >> y, u += x, c += y;
- cout << u << ' ' << c << ' ' << u-c;
- }
- else
- {
- int a, b, u = 0;
- for(int i = 1; i < x; ++i)
- cin >> a >> b, u+=a, u-=b;
- for(int i = x; i <= n; ++i)
- cin >> a >> b;
- if(u < y)
- cout << "NU";
- else
- cout << "DA";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment