Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- #define pb(x) push_back(x)
- #define pii pair <int,int>
- using namespace std;
- int main()
- {
- int t; cin >> t;
- int T[t];
- for(int i=0;i<t;i++)cin >> T[i];
- int m; cin >> m;
- vector < pii > v;
- while(m--){
- int a,b; cin >> a >> b;
- v.pb(make_pair(a,b));
- }
- for(pii x : v){
- int i = x.first, j = x.second;
- int time = 0;
- for(int q=0;q<t;q++){
- if(q == i)time += j;
- else time += T[q];
- }
- cout << time << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement