stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include<cstdio>

#include<vector>

#include<cstring>

#include<algorithm>

#define int long long

using namespace std;

const int N=100005;

int X[N],cha[N],p[N],cnt[N];

int a[N],dfn[N],c[N];

vector<long long> O[N];

int n,m,k,num,s;

void find(int x,int len){

    dfn[x]=len,c[x]=num;

    cnt[num]++;

    O[num].push_back(x);

    if(!c[p[x]]) find(p[x],len+1);

}

signed main (){

    scanf("%lld",&n);

    for(int i=1;i<=n;i++)

    scanf("%lld",&X[i]),cha[i-1]=X[i]-X[i-1];

    for(int i=1;i<=n;i++) 

    p[i]=i;

    

	scanf("%lld%lld",&m,&k);

    for(int i=1;i<=m;i++)

    scanf("%lld",&a[i]),

	swap(p[a[i]],p[a[i]-1]);

	

    for(int i=1;i<=n;i++)if(!dfn[i]) 

	num++,find(i,0);

    s=X[1],printf("%.1lf\n",1.0*s);

    for(int i=1;i<n;i++){

    	int pos=(dfn[i]+k)%O[c[i]].size();

		printf("%.1lf\n",1.0*(s+=cha[O[c[i]][pos]]));

	}

}

// Faster C++ solution for the same problem (measured speedup: 3.4383260025676265x):
#include<iostream>

#include<cstdio>

#include<cstdlib>

#include<cstring>

#include<cmath>

#include<algorithm>

#include<vector>

using namespace std;

#define ll long long

#define MAX 100100

inline int read()

{

	int x=0;bool t=false;char ch=getchar();

	while((ch<'0'||ch>'9')&&ch!='-')ch=getchar();

	if(ch=='-')t=true,ch=getchar();

	while(ch<='9'&&ch>='0')x=x*10+ch-48,ch=getchar();

	return t?-x:x;

}

int n,x[MAX],m,d[MAX],ans[MAX],tmp[MAX];ll K;

double a[MAX];

int main()

{

	n=read();

	for(int i=1;i<=n;++i)x[i]=read();

	m=read();cin>>K;

	for(int i=1;i<=n;++i)d[i]=i,ans[i]=i;

	for(int i=1;i<=m;++i)

	{

		int x=read();

		swap(d[x],d[x+1]);

	}

	while(K)

	{

		if(K&1)

		{

			for(int i=1;i<=n;++i)tmp[i]=ans[d[i]];

			for(int i=1;i<=n;++i)ans[i]=tmp[i];

		}

		for(int i=1;i<=n;++i)tmp[i]=d[d[i]];

		for(int i=1;i<=n;++i)d[i]=tmp[i];

		K>>=1;

	}

	for(int i=1;i<=n;++i)a[i]=x[ans[i]]-x[ans[i]-1];

	for(int i=1;i<=n;++i)printf("%.1lf\n",a[i]+=a[i-1]);

	return 0;

}
// Slower C++ solution:
#include<cstdio>

#include<vector>

#include<cstring>

#include<algorithm>

#define int long long

using namespace std;

const int N=100005;

int X[N],cha[N],p[N],cnt[N];

int a[N],dfn[N],c[N];

vector<long long> O[N];

int n,m,k,num,s;

void find(int x,int len){

    dfn[x]=len,c[x]=num;

    cnt[num]++;

    O[num].push_back(x);

    if(!c[p[x]]) find(p[x],len+1);

}

signed main (){

    scanf("%lld",&n);

    for(int i=1;i<=n;i++)

    scanf("%lld",&X[i]),cha[i-1]=X[i]-X[i-1];

    for(int i=1;i<=n;i++) 

    p[i]=i;

    

	scanf("%lld%lld",&m,&k);

    for(int i=1;i<=m;i++)

    scanf("%lld",&a[i]),

	swap(p[a[i]],p[a[i]-1]);

	

    for(int i=1;i<=n;i++)if(!dfn[i]) 

	num++,find(i,0);

    s=X[1],printf("%.1lf\n",1.0*s);

    for(int i=1;i<n;i++){

    	int pos=(dfn[i]+k)%O[c[i]].size();

		printf("%.1lf\n",1.0*(s+=cha[O[c[i]][pos]]));

	}

}

// Faster C++ solution for the same problem (measured speedup: 3.4043687580539768x):
#include <bits/stdc++.h>

#define MAX 100005

#define ll long long

#define P 998244353

using namespace std;



int n, m;

ll k, b[MAX];

double a[MAX], tmp[MAX];



void calc(ll k){

	while(k){

		if(k&1){

			for(int i = 1; i <= n; i++) tmp[i] = a[b[i]];

			for(int i = 1; i <= n; i++) a[i] = tmp[i];

		}

		for(int i = 1; i <= n; i++) tmp[i] = b[b[i]];

		for(int i = 1; i <= n; i++) b[i] = tmp[i];

		k >>= 1;

	}

}



int main()

{

	cin >> n;

	for(int i = 1; i <= n; i++){

		scanf("%lf", &a[i]);

		b[i] = i;

	}

	for(int i = n; i >= 1; i--){

		a[i] -= a[i-1];

	}

	cin >> m >> k;

	int x;

	for(int i = 1; i <= m; i++){

		scanf("%d", &x);

		swap(b[x], b[x+1]);

	}

	calc(k);

	double s = 0;

	for(int i = 1; i <= n; i++){

		s += a[i];

		printf("%.1lf\n", s);

	}

	

	return 0;

}
// Slower C++ solution:
#include<cstdio>

#include<vector>

#include<cstring>

#include<algorithm>

#define int long long

using namespace std;

const int N=100005;

int X[N],cha[N],p[N],cnt[N];

int a[N],dfn[N],c[N];

vector<long long> O[N];

int n,m,k,num,s;

void find(int x,int len){

    dfn[x]=len,c[x]=num;

    cnt[num]++;

    O[num].push_back(x);

    if(!c[p[x]]) find(p[x],len+1);

}

signed main (){

    scanf("%lld",&n);

    for(int i=1;i<=n;i++)

    scanf("%lld",&X[i]),cha[i-1]=X[i]-X[i-1];

    for(int i=1;i<=n;i++) 

    p[i]=i;

    

	scanf("%lld%lld",&m,&k);

    for(int i=1;i<=m;i++)

    scanf("%lld",&a[i]),

	swap(p[a[i]],p[a[i]-1]);

	

    for(int i=1;i<=n;i++)if(!dfn[i]) 

	num++,find(i,0);

    s=X[1],printf("%.1lf\n",1.0*s);

    for(int i=1;i<n;i++){

    	int pos=(dfn[i]+k)%O[c[i]].size();

		printf("%.1lf\n",1.0*(s+=cha[O[c[i]][pos]]));

	}

}

// Faster C++ solution for the same problem (measured speedup: 3.484083579196544x):
#include<bits/stdc++.h>

//#include<tr1/unordered_map>

//#include"Bignum/bignum.h"

//#define lll bignum

#define ls(x) ( x << 1 )

#define rs(x) ( x << 1 | 1 )

//#define mid ( ( l + r ) >> 1 )

#define lowbit(x) ( x & -x )

#define debug(x) (cout << "#x = " << x << endl)

#define re register

#define For(i, j, k) for(re int i = (j); i <= (k); i++)

#define foR(i, j, k) for(re int i = (j); i >= (k); i--)

#define Cross(i, j, k) for(re int i = (j); i; i = (k))

using namespace std;

typedef long long ll;

const ll N = 100011;

const ll inf = 0x3f3f3f3f3f3f;



ll n, m, k, x, a[N], b[N], c[N], B[N];

double res = 0;



namespace IO {



	#define dd ch = getchar()

	inline ll read() {

		ll x = 0; bool f = 0; char dd;

		for (; !isdigit (ch); dd) f ^= (ch == '-');

		for (; isdigit (ch); dd)  x = (x << 3) + (x << 1) + (ch ^ 48);

		return f? -x: x;

	}

	#undef dd



	inline void write( ll x ) {

		if ( x < 0 ) putchar ( '-' ), x = -x;

		if ( x > 9 ) write ( x / 10 ); putchar ( x % 10 | 48 );

	}



	inline void wrn ( ll x ) { write (x); putchar ( ' ' ); }



	inline void wln ( ll x ) { write (x); putchar ( '\n' ); }



	inline void wlnn ( ll x, ll y ) { wrn (x), wln (y); }



}



using namespace IO;



inline void Redouble ( ll x ) {

	for (; x; x >>= 1) {

		if (x & 1) {

			For ( i, 1, n ) B[i] = a[b[i]]; 

			For ( i, 1, n ) a[i] = B[i];

		}

		For ( i, 1, n ) B[i] = b[b[i]]; 

		For ( i, 1, n ) b[i] = B[i];

	}

}



int main() 

{

	n = read(); 

	For ( i, 1, n ) a[i] = read(), b[i] = i;

	foR ( i, n, 1 ) a[i] = a[i] - a[i - 1];

	m = read(), k = read();

	For ( i, 1, m ) x = read(), swap ( b[x], b[x + 1] );

	Redouble (k);

	For ( i, 1, n ) 

		res += a[i], printf ("%.1lf\n", res);

	return 0;

}



/*



*/
// Slower C++ solution:
#include<cstdio>

#include<vector>

#include<cstring>

#include<algorithm>

#define int long long

using namespace std;

const int N=100005;

int X[N],cha[N],p[N],cnt[N];

int a[N],dfn[N],c[N];

vector<long long> O[N];

int n,m,k,num,s;

void find(int x,int len){

    dfn[x]=len,c[x]=num;

    cnt[num]++;

    O[num].push_back(x);

    if(!c[p[x]]) find(p[x],len+1);

}

signed main (){

    scanf("%lld",&n);

    for(int i=1;i<=n;i++)

    scanf("%lld",&X[i]),cha[i-1]=X[i]-X[i-1];

    for(int i=1;i<=n;i++) 

    p[i]=i;

    

	scanf("%lld%lld",&m,&k);

    for(int i=1;i<=m;i++)

    scanf("%lld",&a[i]),

	swap(p[a[i]],p[a[i]-1]);

	

    for(int i=1;i<=n;i++)if(!dfn[i]) 

	num++,find(i,0);

    s=X[1],printf("%.1lf\n",1.0*s);

    for(int i=1;i<n;i++){

    	int pos=(dfn[i]+k)%O[c[i]].size();

		printf("%.1lf\n",1.0*(s+=cha[O[c[i]][pos]]));

	}

}

// Faster C++ solution for the same problem (measured speedup: 3.431151589351336x):
#include<iostream>

#include<cstdio>

#include<cstdlib>

#include<cstring>

#include<cmath>

#include<algorithm>

#include<vector>

using namespace std;

int n,x[100100],m,d[100100],ans[100100],tmp[100100];long long K;

double a[100100];

int main()

{

    cin>>n;

    for(int i=1;i<=n;++i)cin>>x[i];

    cin>>m>>K;

    for(int i=1;i<=n;++i)d[i]=i,ans[i]=i;

    for(int i=1;i<=m;++i)

    {

    	int x;

        cin>>x;

        swap(d[x],d[x+1]);

    }

    while(K)

    {

        if(K&1)

        {

            for(int i=1;i<=n;++i)tmp[i]=ans[d[i]];

            for(int i=1;i<=n;++i)ans[i]=tmp[i];

        }

        for(int i=1;i<=n;++i)tmp[i]=d[d[i]];

        for(int i=1;i<=n;++i)d[i]=tmp[i];

        K>>=1;

    }

    for(int i=1;i<=n;++i)a[i]=x[ans[i]]-x[ans[i]-1];

    for(int i=1;i<=n;++i)printf("%.1lf\n",a[i]+=a[i-1]);

    return 0;

}
// Slower C++ solution:
#include<cstdio>

#include<vector>

#include<cstring>

#include<algorithm>

#define int long long

using namespace std;

const int N=100005;

int X[N],cha[N],p[N],cnt[N];

int a[N],dfn[N],c[N];

vector<long long> O[N];

int n,m,k,num,s;

void find(int x,int len){

    dfn[x]=len,c[x]=num;

    cnt[num]++;

    O[num].push_back(x);

    if(!c[p[x]]) find(p[x],len+1);

}

signed main (){

    scanf("%lld",&n);

    for(int i=1;i<=n;i++)

    scanf("%lld",&X[i]),cha[i-1]=X[i]-X[i-1];

    for(int i=1;i<=n;i++) 

    p[i]=i;

    

	scanf("%lld%lld",&m,&k);

    for(int i=1;i<=m;i++)

    scanf("%lld",&a[i]),

	swap(p[a[i]],p[a[i]-1]);

	

    for(int i=1;i<=n;i++)if(!dfn[i]) 

	num++,find(i,0);

    s=X[1],printf("%.1lf\n",1.0*s);

    for(int i=1;i<n;i++){

    	int pos=(dfn[i]+k)%O[c[i]].size();

		printf("%.1lf\n",1.0*(s+=cha[O[c[i]][pos]]));

	}

}

// Faster C++ solution for the same problem (measured speedup: 3.4311899549958933x):
#include<iostream>

#include<algorithm>

#include<cstring>

#include<cstdio>

using namespace std;

#define MAXN 100006

#define int long long

int A[MAXN];

int p[63][MAXN] , ans[MAXN] , Ans[MAXN] , d[MAXN];

int n , m; long long k;

main() {

    cin >> n;

    for( int i = 1 ; i <= n ; ++ i ) scanf("%lld",&A[i]) , d[i] = A[i] - A[i-1];

    cin >> m >> k;

    for( int i = 1 ; i <= n ; ++ i ) p[0][i] = i , Ans[i] = i;

    for( int i = 1 ; i <= m ; ++ i ) {

        scanf("%lld",&A[i]);

        swap( p[0][A[i]] , p[0][A[i]+1] );

    }

    for( int t = 1 ; t < 63 ; ++ t )

        for( int i = 1 ; i <= n ; ++ i ) 

            p[t][i] = p[t-1][p[t-1][i]];

    int c = k;

    for( int k = 62 ; k >= 0 ; -- k ) if( ( 1LL << k ) <= c ) {

        c -= ( 1LL << k );

        for( int i = 1 ; i <= n ; ++ i )

            Ans[i] = p[k][Ans[i]];

    }

    for( int i = 1 ; i <= n ; ++ i )

        ans[i] = d[Ans[i]];

    int as = 0;

    for( int i = 1 ; i <= n ; ++ i ) as += ans[i] , printf("%lld\n",as);

}

/*

5

1 3 6 10 15

2

10

3 4

*/
// Slower C++ solution:
#include<cstdio>

#include<vector>

#include<cstring>

#include<algorithm>

#define int long long

using namespace std;

const int N=100005;

int X[N],cha[N],p[N],cnt[N];

int a[N],dfn[N],c[N];

vector<long long> O[N];

int n,m,k,num,s;

void find(int x,int len){

    dfn[x]=len,c[x]=num;

    cnt[num]++;

    O[num].push_back(x);

    if(!c[p[x]]) find(p[x],len+1);

}

signed main (){

    scanf("%lld",&n);

    for(int i=1;i<=n;i++)

    scanf("%lld",&X[i]),cha[i-1]=X[i]-X[i-1];

    for(int i=1;i<=n;i++) 

    p[i]=i;

    

	scanf("%lld%lld",&m,&k);

    for(int i=1;i<=m;i++)

    scanf("%lld",&a[i]),

	swap(p[a[i]],p[a[i]-1]);

	

    for(int i=1;i<=n;i++)if(!dfn[i]) 

	num++,find(i,0);

    s=X[1],printf("%.1lf\n",1.0*s);

    for(int i=1;i<n;i++){

    	int pos=(dfn[i]+k)%O[c[i]].size();

		printf("%.1lf\n",1.0*(s+=cha[O[c[i]][pos]]));

	}

}

// Faster C++ solution for the same problem (measured speedup: 3.480135646758269x):
#include<bits/stdc++.h>

using namespace std;

#define int long long

inline int read(){

	int x=0,f=0;

	char ch=getchar();

	for (;ch<'0'||ch>'9';ch=getchar()) f^=(ch=='-');

	for (;ch>='0'&&ch<='9';ch=getchar()) x=x*10+ch-'0';

	return f ? -x :x ;

}

const int maxn=1e5+20;

int n,a[maxn],pos[maxn],c[maxn],m,k,s[maxn],top,ans[maxn];

bool vis[maxn];

signed main(){

	n=read();

	for (int i=1;i<=n;++i) {

		a[i]=read();

		pos[i]=i;

	}

	for (int i=1;i<=n;++i) c[i]=a[i]-a[i-1];

	m=read();

	k=read();

	for (int i=1,x;i<=m;++i) {

		x=read();

		swap(pos[x],pos[x+1]);

	}

	for (int i=1;i<=n;++i) {

		if (!vis[i]) {

			top=0;

			for (int j=i;!vis[j];j=pos[j]) {

				s[++top]=j;

				vis[j]=1;

			}

			for (int j=1;j<=top;++j) {

				ans[s[j]]=c[s[(k+j-1)%top+1]];

			}

		}

	}

	for (int i=1;i<=n;++i) {

		ans[i]+=ans[i-1];

		printf("%lld",ans[i]);

		putchar('.');

		putchar('0');

		putchar('\n');

	}

 	return 0;

}
// Slower C++ solution:
#include<cstdio>

#include<vector>

#include<cstring>

#include<algorithm>

#define int long long

using namespace std;

const int N=100005;

int X[N],cha[N],p[N],cnt[N];

int a[N],dfn[N],c[N];

vector<long long> O[N];

int n,m,k,num,s;

void find(int x,int len){

    dfn[x]=len,c[x]=num;

    cnt[num]++;

    O[num].push_back(x);

    if(!c[p[x]]) find(p[x],len+1);

}

signed main (){

    scanf("%lld",&n);

    for(int i=1;i<=n;i++)

    scanf("%lld",&X[i]),cha[i-1]=X[i]-X[i-1];

    for(int i=1;i<=n;i++) 

    p[i]=i;

    

	scanf("%lld%lld",&m,&k);

    for(int i=1;i<=m;i++)

    scanf("%lld",&a[i]),

	swap(p[a[i]],p[a[i]-1]);

	

    for(int i=1;i<=n;i++)if(!dfn[i]) 

	num++,find(i,0);

    s=X[1],printf("%.1lf\n",1.0*s);

    for(int i=1;i<n;i++){

    	int pos=(dfn[i]+k)%O[c[i]].size();

		printf("%.1lf\n",1.0*(s+=cha[O[c[i]][pos]]));

	}

}

// Faster C++ solution for the same problem (measured speedup: 3.5065681163958407x):
#include<bits/stdc++.h>

#define R register int

#define ll long long

using namespace std;

namespace Luitaryi {

inline ll g() { register ll x=0,f=1;

	register char ch; while(!isdigit(ch=getchar())) f=ch=='-'?-1:f;

	do x=x*10+(ch^48); while(isdigit(ch=getchar())); return x*f;

} const int N=100010;

ll n,m,k,a[N],p[N],stk[N],ans[N]; bool vis[N];

inline void main() {

	n=g(); for(R i=1;i<=n;++i) a[i]=g(),p[i]=i;

	for(R i=n;~i;--i) a[i]-=a[i-1];

	m=g(),k=g(); for(R i=1,x;i<=m;++i) x=g(),swap(p[x],p[x+1]);

	for(R i=1;i<=n;++i) {

		if(!vis[i]) { R top=0;

			for(R j=i;!vis[j];j=p[j]) stk[++top]=j,vis[j]=true;

			for(R j=1;j<=top;++j) ans[stk[j]]=a[stk[(k+j-1)%top+1]];

		}

	} for(R i=1;i<=n;++i) ans[i]+=ans[i-1],printf("%lld.0\n",ans[i]);

}

} signed main() {Luitaryi::main(); return 0;}
// Slower C++ solution:
#include <cstdio>

#include <algorithm>

#include <vector>



#define int long long

using namespace std;

const int N=100005;



int n,m;

int x[N],a[N],poi[N],cf[N],cnt;

long long k;

int block[N],num[N],vis[N];



vector<int>q[N];



void dfs(int x,int dep)

{

    num[x]=dep;vis[x]=1;block[x]=cnt;

    q[cnt].push_back(x);

    if(!vis[poi[x]]) dfs(poi[x],dep+1);

}

signed main()

{

    scanf("%lld",&n);

    for(int i=1;i<=n;++i) scanf("%lld",&x[i]);

    for(int i=1;i<n;++i) cf[i]=x[i+1]-x[i];

    scanf("%lld%lld",&m,&k);

    for(int i=1;i<n;++i)poi[i]=i;

    for(int i=1;i<=m;++i) {scanf("%lld",&a[i]);swap(poi[a[i]],poi[a[i]-1]);}

    for(int i=1;i<n;++i) if(!vis[i]) cnt++,dfs(i,0);

    

    printf("%lld\n",x[1]);

    int now=x[1];

    for(int i=1;i<n;i++)

    {

        now+=cf[q[block[i]][(num[i]+k)%q[block[i]].size()]];

        printf("%lld\n",now);

    }

}

// Faster C++ solution for the same problem (measured speedup: 3.4838155411636875x):
#include <bits/stdc++.h>

using namespace std;

const int N = 100010;

typedef long long ll;

int n,m,p[N],per[N],vis[N],ans[N],lop[N],cnt;

ll k,val[N],res[N];

int main() {

  scanf("%d",&n);

  for (int i = 1 ; i <= n ; ++ i)

    scanf("%lld",&val[i]);

  scanf("%d%lld",&m,&k);

  for (int i = 1 ; i <= m ; ++ i)

    scanf("%d",&p[i]);

  for (int i = n ; i >= 1 ; -- i)

    val[i] = val[i] - val[i-1];

  for (int i = 1 ; i <= n ; ++ i)

    per[i] = i;

  for (int i = 1 ; i <= m ; ++ i)

    swap(per[p[i]],per[p[i]+1]);

  for (int i = 1 ; i <= n ; ++ i) {

    if (vis[i]) continue;

    cnt = 0;

    lop[++cnt] = i;

    int pos = per[i];

    while (pos != i) {

      vis[pos] = 1;

      lop[++cnt] = pos;

      pos = per[pos];

    }

    for (int j = 1 ; j <= cnt ; ++ j)

      ans[lop[j]] = lop[(j + k - 1) % cnt + 1];

  }

  for (int i = 1 ; i <= n ; ++ i)

    res[i] = val[ans[i]];

  for (int i = 1 ; i <= n ; ++ i)

    res[i] += res[i-1];

  for (int i = 1 ; i <= n ; ++ i)

    printf("%lld.0\n",res[i]);

  return 0;

}
// Slower C++ solution:
#include <cstdio>

#include <vector>

using namespace std;



const int N = 1e5 + 100;

#define int long long



int n, m, x[N], a[N];

int s[N], p[N];

int tot, k;

int bel[N], dep[N];

int vis[N];

vector <int> v[N];



void dfs(int u, int depth) {

  dep[u] = depth;

  vis[u] = 1;

  bel[u] = tot;

  v[tot].push_back(u);

  if (!vis[p[u]]) {

    dfs(p[u], depth + 1);

  }

}



signed main() {

  scanf("%lld", &n);

  for (int i = 1; i <= n; i++) {

    scanf("%lld", &x[i]);

  }

  for (int i = 1; i < n; i++) {

    s[i] = x[i + 1] - x[i];

    p[i] = i;

  }

  scanf("%lld %lld", &m, &k);

  for (int i = 1; i <= m; i++) {

    scanf("%lld", &a[i]);

    swap(p[a[i]], p[a[i] - 1]);

  }

  for (int i = 1; i < n; i++) {

    if (vis[i] == 0) {

      tot++;

      dfs(i, 0);

    }

  }

  printf("%lld\n", x[1]);

  int cur = x[1];

  for (int i = 1; i < n; i++) {

    cur += s[v[bel[i]][(dep[i] + k) % v[bel[i]].size()]];

    printf("%lld\n", cur);

  }

  return 0;

}

// Faster C++ solution for the same problem (measured speedup: 3.4555387418735677x):
#include<iostream>

#include<cstdio>

#include<cstring>

#define N 100010

#define ll long long

using namespace std;

ll f[N],p[N],s[N],ans[N];

int n;

void get_nxt(ll f[],const ll g[])

{

	for(int i=1;i<=n;i++) s[i]=f[g[i]];

	for(int i=1;i<=n;i++) f[i]=s[i];

}

void ksm(ll f[],ll k)

{

	for(int i=1;i<=n;i++) ans[i]=i;

	for(;k;k>>=1)

	{

		if(k&1) get_nxt(ans,f);

		get_nxt(f,f);

	}

}

int main()

{

	scanf("%d",&n);

	for(int i=1;i<=n;i++) scanf("%lld",&f[i]),p[i]=i;

	int m;

	ll k;

	scanf("%d%lld",&m,&k);

	for(int i=1;i<=m;i++)

	{

		int a;

		scanf("%d",&a);

		swap(p[a],p[a+1]);

	}

	ksm(p,k);

	for(int i=1;i<=n;i++) printf("%lld\n",s[i]=s[i-1]+f[ans[i]]-f[ans[i]-1]);

	return 0;

}
// Slower C++ solution:
#include <cstdio>

#include <vector>

using namespace std;



const int N = 1e5 + 100;

#define int long long



int n, m, x[N], a[N];

int s[N], p[N];

int tot, k;

int bel[N], dep[N];

int vis[N];

vector <int> v[N];



void dfs(int u, int depth) {

  dep[u] = depth;

  vis[u] = 1;

  bel[u] = tot;

  v[tot].push_back(u);

  if (!vis[p[u]]) {

    dfs(p[u], depth + 1);

  }

}



signed main() {

  scanf("%lld", &n);

  for (int i = 1; i <= n; i++) {

    scanf("%lld", &x[i]);

  }

  for (int i = 1; i < n; i++) {

    s[i] = x[i + 1] - x[i];

    p[i] = i;

  }

  scanf("%lld %lld", &m, &k);

  for (int i = 1; i <= m; i++) {

    scanf("%lld", &a[i]);

    swap(p[a[i]], p[a[i] - 1]);

  }

  for (int i = 1; i < n; i++) {

    if (vis[i] == 0) {

      tot++;

      dfs(i, 0);

    }

  }

  printf("%lld\n", x[1]);

  int cur = x[1];

  for (int i = 1; i < n; i++) {

    cur += s[v[bel[i]][(dep[i] + k) % v[bel[i]].size()]];

    printf("%lld\n", cur);

  }

  return 0;

}

// Faster C++ solution for the same problem (measured speedup: 3.4987605989961326x):


#include <bits/stdc++.h>

typedef long long ll;

const int maxn = 1e6 + 5;



inline ll read()

{

    ll w = 0;

    ll t = 1;

    char ch = getchar();

    while (ch > '9' || ch < '0') {if (ch == '-') t = -1; ch = getchar();}

    while (ch >= '0' && ch <= '9') { w = (w << 3) + (w << 1) + (ch ^ '0'); ch = getchar();}

    return w * t;

}

int n, m;

ll k;

ll a[maxn];

int vis[maxn], to[maxn], c[maxn];

ll ans[maxn];

int main()

{

    n = read();

    ll lst = 0;

    for (int i = 1; i <= n; i++)

    {

        a[i] = read() - lst;

        lst += a[i];

        to[i] = i;

    }

    m = read(), k = read();

    int input;

    for (int i = 1; i <= m; i++)

        input = read(), std::swap(to[input], to[input + 1]);

    for (int i = 1; i <= n; i++)

        if (!vis[i])

        {

            int cnt = 0, j;

            for (j = i; !vis[j]; j = to[j])

                vis[j] = 1, c[++cnt] = j;

            for (j = 1; j <= cnt; j++)

                ans[c[j]] = a[c[(j + k - 1) % cnt + 1]];

        }

    for (int i = 1; i <= n; i++)

    {

        printf("%lld.0\n", ans[i] += ans[i - 1]);

    }

    return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

#define rg register



template <typename _Tp> inline _Tp read(_Tp&x){

	char c11=getchar(),ob=0;x=0;

	while(c11^'-'&&!isdigit(c11))c11=getchar();if(c11=='-')ob=1,c11=getchar();

	while(isdigit(c11))x=x*10+c11-'0',c11=getchar();if(ob)x=-x;return x;

}



const int N=101000;

int a[N],vis[N],st[N];

ll b[N],p[N],k;

int n,m,tp;



void init();void work();void print();

int main(){init();work();print();return 0;}



void work(){

	int x;

	for(rg int i=1;i<=m;++i)read(x),swap(a[x],a[x+1]);

	for(rg int i=1;i<=n;++i)if(!vis[i]){

		vis[st[0]=x=i]=tp=1;

		while(!vis[a[x]])

			vis[st[tp++]=x=a[x]]=1;

		int e=k%tp;

		for(rg int j=0;j<tp;++j)

			b[st[j]]=p[st[j+e<tp?j+e:j+e-tp]];

	}

}



void print(){

	ll sm(0ll);

	for(rg int i=1;i<=n;++i)

		printf("%lld\n",sm+=b[i]);

}



void init(){

	read(n);

	for(rg int i=1;i<=n;++i)read(p[i]),a[i]=i;

	for(rg int i=n;i;--i)p[i]-=p[i-1];

	read(m),read(k);

}

// Faster C++ solution for the same problem (measured speedup: 4.832894308984607x):
#include <cstdio>

#include <cstring>

#include <algorithm>

#define R register

using namespace std;

typedef long long LL;

const int MAXN=100100;

int d[MAXN],pmt[MAXN];



void permute(int a[],int b[],int n)

{

	int t[MAXN];

	for(R int i=1;i<=n;++i)

	  t[i]=a[i];

	for(R int i=1;i<=n;++i)

	  a[i]=t[b[i]];

}



void fpow(int a[],LL y,int n)

{

	while(y)

	{

		if(y&1)permute(d,a,n);

		permute(a,a,n),y>>=1;

	}

}





int main()

{

	int n;

	scanf("%d",&n);

	LL l;

	int t1,t2;

	scanf("%lld",&l);

	t1=l;

	for(R int i=2;i<=n;++i)

	{

		scanf("%d",&t2);

		d[i]=t2-t1;

		t1=t2;

	}

	for(R int i=1;i<=n;++i)

	  pmt[i]=i;

	int m;

	LL k;

	scanf("%d%lld",&m,&k);

	for(R int i=1;i<=m;++i)

	{

		scanf("%d",&t1);

		swap(pmt[t1],pmt[t1+1]);

	}

	fpow(pmt,k,n);

	for(R int i=1;i<=n;++i)

	{

		l+=d[i];

		printf("%lld\n",l);

	}

	return 0;

}