2. the 2-nd singer in the 1-st city will give a concert for 3 minutes , in

1. the 1-st singer in the 1-st city will give a concert for 3 minutes , in

3. the 3-rd singer in the 1-st city will give a concert for 6 minutes , in

# include <bits / stdc ++.h>
using namespace std;
void solve () {

long long int n, i, j;
cin >> n;
vector < long long int > a(n);
for (i = 0; i < n; i++) cin >> a[i];
long long int sum = 0;
for (i = 0; i < n; i++) sum += a[i];
if (sum %

cout << "NO" << ’\n’;
return ;

}
long long int k = sum / (n * (n + 1)

/ 2);

vector < long long int > ans(n);
for (i = 0; i < n; i++) {

long long int p = k - (a[i] - t);
if (p %

long long int t = 0;
if (i == 0)

t = a[n - 1];

else

t = a[i - 1];

cout << "NO" << ’\n’;
return ;

}
ans[i] = p / n;
if (ans[i] <= 0) {

cout << "NO" << ’\n’;
return ;

}

}
cout << "YES" << ’\n’;
for (i = 0; i < n; i++) cout << ans[i

] << " ";
cout << ’\n’;

}
int main () {
alphacode