Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #define int int64_t
- using namespace std;
- int32_t main()
- {
- int n;
- cin >> n;
- int a[n];
- for(auto &i: a)
- cin >> i;
- int f = 1, s = a[0];
- for(int i = 1; i < n; i++){
- cout << f << ' ' << s << '\n';
- f = s + 1;
- s = f + a[i] - 1;
- }
- cout << f << ' ' << s << '\n';
- }
Advertisement
Add Comment
Please, Sign In to add comment