Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int main() {
- int t;
- cin>>t;
- while(t--){
- int n;
- cin>>n;
- vector<int> a(n);
- for(auto &e: a) cin>>e;
- for(int i=0; i<n; i++)
- a[i] += i+1;
- sort(a.rbegin(), a.rend());
- int val = 2e9;
- for(auto e: a)
- {
- if(e >= val)
- {
- cout<<val-1<<" ";
- val--;
- }
- else
- {
- cout<<e<<" ";
- val = e;
- }
- }
- cout<<"\n";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement