ProgMe

Task B

Dec 16th, 2020
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. #include <iostream>
  2. #define int int64_t
  3.  
  4. using namespace std;
  5.  
  6. int32_t main()
  7. {
  8. int n;
  9. cin >> n;
  10. int a[n];
  11. for(auto &i: a)
  12. cin >> i;
  13. int f = 1, s = a[0];
  14. for(int i = 1; i < n; i++){
  15. cout << f << ' ' << s << '\n';
  16. f = s + 1;
  17. s = f + a[i] - 1;
  18. }
  19. cout << f << ' ' << s << '\n';
  20. }
Advertisement
Add Comment
Please, Sign In to add comment