stablegradients/pie-gem5-bysrc huggingface dataset:
// Original C++ solution (slower):
#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);

    }

}

// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}

// Optimized solution to the same problem (faster):


#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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);

}

// Optimized solution to the same problem (faster):
// luogu-judger-enable-o2

#include <cstdio>

#include <cstring>

#include <algorithm>

#include <cctype>

typedef long long int64;

using namespace std;

inline int64 read(int f = 1, int64 x = 0, char ch = ' ')

{

    while(!isdigit(ch = getchar())) if(ch == '-') f = -1;

    while(isdigit(ch)) x = x*10+ch-'0', ch = getchar();

    return f*x;

}

const int N = 1e5+5;

int n, m, a[N], f[N], s[N], top, vis[N];

int64 ans[N], k;

int main()

{

    n = read();

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

    for(int i = n; i; --i) a[i] -= a[i-1], f[i] = i;

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

    for(int i = 1, p; i <= m; ++i) p = read(), swap(f[p], f[p+1]);

    for(int i = 1; i <= n; ++i, top = 0)

        if(!vis[i])

        {

            for(int j = i; !vis[j]; j = f[j]) vis[j] = 1, s[++top] = j;

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

        }

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

    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

const int MN=100000+5;

using namespace std;

typedef long long ll;

typedef pair<int,int> pii;

template<typename T>T&IN(T&in){

	in=0;char c=getchar();int f=1;

	while(!isdigit(c)){if(c=='-')f=-1;c=getchar();}

	while(isdigit(c))in=in*10+c-'0',c=getchar();

	return in*=f;

}

int n,m;ll k;

int fr[MN],st[MN],vis[MN];

ll a[MN],ans[MN];

void input(){

	IN(n);

	for(int i=1;i<=n;++i)IN(a[i]),fr[i]=i;

	for(int i=n;i>=1;--i)a[i]-=a[i-1];

	IN(m),IN(k);

	for(int i=1,x;i<=m;++i)IN(x),swap(fr[x],fr[x+1]);

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

		st[0]=0;

		for(int j=i;!vis[j];j=fr[j])vis[j]=1,st[++st[0]]=j;

		for(int j=1;j<=st[0];++j)ans[st[j]]=a[st[(j+k-1)%st[0]+1]];

	}

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

}

int main(){

	input();

	return 0;

}

// Optimized solution to the same problem (faster):
// luogu-judger-enable-o2

#include <cstdio>

#include <cstring>

#include <algorithm>

#include <cctype>

typedef long long int64;

using namespace std;

inline int64 read(int f = 1, int64 x = 0, char ch = ' ')

{

    while(!isdigit(ch = getchar())) if(ch == '-') f = -1;

    while(isdigit(ch)) x = x*10+ch-'0', ch = getchar();

    return f*x;

}

const int N = 1e5+5;

int n, m, a[N], f[N], s[N], top, vis[N];

int64 ans[N], k;

int main()

{

    n = read();

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

    for(int i = n; i; --i) a[i] -= a[i-1], f[i] = i;

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

    for(int i = 1, p; i <= m; ++i) p = read(), swap(f[p], f[p+1]);

    for(int i = 1; i <= n; ++i, top = 0)

        if(!vis[i])

        {

            for(int j = i; !vis[j]; j = f[j]) vis[j] = 1, s[++top] = j;

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

        }

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

    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

#define N 100005

#define int long long

using namespace std;



inline void rd(int &X){

    X=0;int w=0;char ch=0;

    while(!isdigit(ch))w|=ch=='-',ch=getchar();

    while( isdigit(ch))X=(X<<3)+(X<<1)+(ch^48),ch=getchar();

    X=w?-X:X;

}

int n,m,k;

int x[N],d[N],ans[N],t[N];

double a[N];



signed main()

{

    rd(n);

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

        rd(x[i]),d[i]=i,ans[i]=i;

    rd(m);rd(k);

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

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

        while(k)

        {

            if(k&1)

            {

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

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

            }

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

            for(int i=1;i<=n;++i)d[i]=t[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("%.1f\n",a[i]+=a[i-1]);

}


// Optimized solution to the same problem (faster):
// luogu-judger-enable-o2

#include <cstdio>

#include <cstring>

#include <algorithm>

#include <cctype>

typedef long long int64;

using namespace std;

inline int64 read(int f = 1, int64 x = 0, char ch = ' ')

{

    while(!isdigit(ch = getchar())) if(ch == '-') f = -1;

    while(isdigit(ch)) x = x*10+ch-'0', ch = getchar();

    return f*x;

}

const int N = 1e5+5;

int n, m, a[N], f[N], s[N], top, vis[N];

int64 ans[N], k;

int main()

{

    n = read();

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

    for(int i = n; i; --i) a[i] -= a[i-1], f[i] = i;

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

    for(int i = 1, p; i <= m; ++i) p = read(), swap(f[p], f[p+1]);

    for(int i = 1; i <= n; ++i, top = 0)

        if(!vis[i])

        {

            for(int j = i; !vis[j]; j = f[j]) vis[j] = 1, s[++top] = j;

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

        }

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

    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

#define hh puts("")

#define int long long

using namespace std;

int n,s,a[100005],cha[100005],m,k,t[100005];

inline int read(){

	int ret=0,ff=1;char ch=getchar();

	while(!isdigit(ch)){if(ch=='-') ff=-1;ch=getchar();}

	while(isdigit(ch)){ret=(ret<<3)+(ret<<1)+(ch^48);ch=getchar();}

	return ret*ff;

}

inline void ksm(int p){

	while(p){

		if(p&1){

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

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

		}

		p>>=1;

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

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

	}

}

signed main(){

	n=read();

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

		a[i]=read();

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

	}

	for(int i=1;i<=n;i++) a[i]=i;//改存位置 

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

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

		int t=read();

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

	}

	//当前存的是一套体操后对应位置

	//b[i]表示原来在i位置,一套体操后的位置 

	ksm(k);

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

		s+=cha[i];//把差分数组加上去

		printf("%lld.0\n",s);

	}

	return 0;

}

// Optimized solution to the same problem (faster):
// luogu-judger-enable-o2

#include <cstdio>

#include <cstring>

#include <algorithm>

#include <cctype>

typedef long long int64;

using namespace std;

inline int64 read(int f = 1, int64 x = 0, char ch = ' ')

{

    while(!isdigit(ch = getchar())) if(ch == '-') f = -1;

    while(isdigit(ch)) x = x*10+ch-'0', ch = getchar();

    return f*x;

}

const int N = 1e5+5;

int n, m, a[N], f[N], s[N], top, vis[N];

int64 ans[N], k;

int main()

{

    n = read();

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

    for(int i = n; i; --i) a[i] -= a[i-1], f[i] = i;

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

    for(int i = 1, p; i <= m; ++i) p = read(), swap(f[p], f[p+1]);

    for(int i = 1; i <= n; ++i, top = 0)

        if(!vis[i])

        {

            for(int j = i; !vis[j]; j = f[j]) vis[j] = 1, s[++top] = j;

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

        }

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

    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

#define ll long long

using namespace std;

const ll N=1e5+10;

ll n,m,k,t;

ll a[N],id[N],x[N],sta[N],vis[N],ans[N];

int main(){

	scanf("%lld",&n);

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

	for(ll i=n;i>=1;i--) x[i]-=x[i-1];

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

	for(ll i=1;i<=m;i++) scanf("%lld",&t),swap(id[t],id[t+1]);

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

		if(!vis[i]){

			ll cnt=0;

			for(ll j=i;!vis[j];j=id[j]) sta[++cnt]=j,vis[j]=1;

			for(ll j=1;j<=cnt;j++) ans[sta[j]]=x[sta[(j+k-1)%cnt+1]];

		}

	}

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

}

// Optimized solution to the same problem (faster):
// luogu-judger-enable-o2

#include <cstdio>

#include <cstring>

#include <algorithm>

#include <cctype>

typedef long long int64;

using namespace std;

inline int64 read(int f = 1, int64 x = 0, char ch = ' ')

{

    while(!isdigit(ch = getchar())) if(ch == '-') f = -1;

    while(isdigit(ch)) x = x*10+ch-'0', ch = getchar();

    return f*x;

}

const int N = 1e5+5;

int n, m, a[N], f[N], s[N], top, vis[N];

int64 ans[N], k;

int main()

{

    n = read();

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

    for(int i = n; i; --i) a[i] -= a[i-1], f[i] = i;

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

    for(int i = 1, p; i <= m; ++i) p = read(), swap(f[p], f[p+1]);

    for(int i = 1; i <= n; ++i, top = 0)

        if(!vis[i])

        {

            for(int j = i; !vis[j]; j = f[j]) vis[j] = 1, s[++top] = j;

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

        }

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

    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

#define N 100005

#define int long long

using namespace std;

int n,m,x[N],a[N],p[N],s[N],cnt;

long long k;

int be[N],num[N],v[N];

vector<int>q[N];

void dfs(int x,int dep)

{

    num[x]=dep;v[x]=1;be[x]=cnt;

    q[cnt].push_back(x);

    if(!v[p[x]])dfs(p[x],dep+1);

}

signed main()

{

    memset(v,0,sizeof(v));

    cin>>n;

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

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

    cin>>m>>k;

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

    for(int i=1;i<=m;i++){cin>>a[i];swap(p[a[i]],p[a[i]-1]);}

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

    cout<<x[1]<<endl;

    int now=x[1];

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

    {

        now+=s[q[be[i]][(num[i]+k)%q[be[i]].size()]];

        cout<<now<<endl;

    }

    return 0;

}

// Optimized solution to the same problem (faster):


#include<stdio.h>

#include<string.h>

#include<stdlib.h>

#include<iostream>

#include<algorithm>

using namespace std;



typedef long long LL;



namespace INPUT {

	const int L = 1 << 15;

	char _buf[L], *S, *T, c;

	char _gc () {

		if (S == T) {

			T = (S = _buf) + fread (_buf, 1, L, stdin);

			if (S == T) return EOF;

		}

		return *S++;

	}

	void readi (int &X) {

		bool flag;

		for (c = _gc (); (c < '0' || c > '9') && c != '-'; c = _gc ());

		if (c == '-') X = 0, flag = true; else X = c & 15, flag = false;

		for (c = _gc (); c >= '0' && c <= '9'; X = X * 10 + (c & 15), c = _gc ());

		if (flag) X = -X;

	}

	void readl (LL &X) {

		bool flag;

		for (c = _gc (); (c < '0' || c > '9') && c != '-'; c = _gc ());

		if (c == '-') X = 0, flag = true; else X = c & 15, flag = false;

		for (c = _gc (); c >= '0' && c <= '9'; X = X * 10 + (c & 15), c = _gc ());

		if (flag) X = -X;

	}

}

using INPUT :: readi;

using INPUT :: readl;



const int Maxn = 1E5 + 5;



int N, M; LL K;

int x[Maxn];

int a[Maxn];



int lnk[Maxn];

bool vis[Maxn];

int stk[Maxn], tp;



int ans[Maxn];



void Dfs (int u) {

	if (vis[u]) return ;

	vis[u] = true, stk[++tp] = u, Dfs (lnk[u]);

}



int main () {

	readi (N);

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

		readi (x[i]), lnk[i] = i;

	readi (M), readl (K);

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

		readi (a[i]), swap (lnk[a[i] - 1], lnk[a[i]]);

	memset (vis, false, sizeof (vis));

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

	if (!vis[i]) {

		tp = 0, Dfs (i);

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

			ans[stk[j]] = stk[(j + K - 1) % tp + 1];

	}

/*	for (int i = 1; i < N; ++i)

		cerr << lnk[i] << ' '; cerr<<endl;

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

		cerr << ans[i] << ' '; cerr<<endl;*/

	LL Ans = x[1];

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

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

		Ans += x[ans[i] + 1] - x[ans[i]],

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

	return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

#define N 100005

#define int long long

using namespace std;

int n,m,x[N],a[N],p[N],s[N],cnt;

long long k;

int be[N],num[N],v[N];

vector<int>q[N];

void dfs(int x,int dep)

{

    num[x]=dep;v[x]=1;be[x]=cnt;

    q[cnt].push_back(x);

    if(!v[p[x]])dfs(p[x],dep+1);

}

signed main()

{

    memset(v,0,sizeof(v));

    cin>>n;

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

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

    cin>>m>>k;

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

    for(int i=1;i<=m;i++){cin>>a[i];swap(p[a[i]],p[a[i]-1]);}

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

    cout<<x[1]<<endl;

    int now=x[1];

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

    {

        now+=s[q[be[i]][(num[i]+k)%q[be[i]].size()]];

        cout<<now<<endl;

    }

    return 0;

}

// Optimized solution to the same problem (faster):
#include<cstdio>

#include<algorithm>

#define int long long

const int N=200003;

int x[N],ans[N],g[N],n,m,k,used[N],siz;

signed main(){

	scanf("%lld",&n);

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

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

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

	for(int i,j=1;j<=m;j++)scanf("%lld",&i),std::swap(g[i],g[i+1]);

	for(int i=1,j,v;i<=n;i++)if(!used[i]){

	  siz=1;

	  for(j=g[i];j!=i;j=g[j])

		siz++;

	  j=i;

	  for(int id=1;id<=k%siz;id++)j=g[j];

	  ans[i]=x[j],used[j]=1;

	  for(j=g[j],v=g[i];!used[j];j=g[j],v=g[v])

		ans[v]=x[j],used[j]=1;

	}

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

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<cstdio>

#include<iostream>

#include<algorithm>

#include<cstring>

#include<vector>

#include<cmath>

#include<queue>

#include<map>

#include<set>

#define int long long

#define ri register int

#define max maxx

#define min minn

using namespace std;

const int N=1e5+10;

template <class T> void in(T &x) {

	x = 0;

	bool f = 0;

	char c = getchar();

	while (c < '0' || c > '9') {

		if (c == '-') f = 1;

		c = getchar();

	}

	while ('0' <= c && c <= '9') {

		x = (x << 3) + (x << 1) + (c ^ 48);

		c = getchar();

	}

	if (f) x = -x;

}

inline int maxx(int x,int y) {

	return x>y?x:y;

}

inline int minn(int x,int y) {

	return x<y?x:y;

}

inline int gcd(int x,int y) {

	return !y?x:gcd(y,x%y);

}

int l[N],cor[N],pos[N];

int a[N],dif[N],m,k,n,cnt,x;

vector<int> v[N];

inline void dfs(int x,int p) {

	l[x]=p;

	cor[x]=cnt;

	v[cnt].push_back(x);

	if(!cor[pos[x]])

		dfs(pos[x],++p);

}

signed main() {

	in(n);

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

		in(a[i]),pos[i]=i,dif[i-1]=a[i]-a[i-1];

	in(m),in(k);

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

		in(x),swap(pos[x],pos[x-1]);

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

		if(!l[i])

			cnt++,dfs(i,0);

	printf("%.1lf\n",(double)a[1]);

	int last=a[1];

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

		last+=dif[v[cor[i]][(l[i]+k)%v[cor[i]].size()]],printf("%.1lf\n",(double)last);

	return 0;

}

// Optimized solution to the same problem (faster):
#include<cstdio>

#include<algorithm>

#define int long long

const int N=200003;

int x[N],ans[N],g[N],n,m,k,used[N],siz;

signed main(){

	scanf("%lld",&n);

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

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

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

	for(int i,j=1;j<=m;j++)scanf("%lld",&i),std::swap(g[i],g[i+1]);

	for(int i=1,j,v;i<=n;i++)if(!used[i]){

	  siz=1;

	  for(j=g[i];j!=i;j=g[j])

		siz++;

	  j=i;

	  for(int id=1;id<=k%siz;id++)j=g[j];

	  ans[i]=x[j],used[j]=1;

	  for(j=g[j],v=g[i];!used[j];j=g[j],v=g[v])

		ans[v]=x[j],used[j]=1;

	}

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

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

#define reg register

using namespace std;



typedef long long ll;

const int maxn = 100005;



inline ll read() {

    reg ll s = 0, t = 0; reg char ch = getchar();

    while (!isdigit(ch)) t |= ch == '-', ch = getchar();

    while (isdigit(ch)) s = (s << 1) + (s << 3) + (ch ^ 48), ch = getchar();

    return t ? -s : s;

}



int n, m, a[maxn], d[maxn], x[maxn], pos[maxn], Stack[maxn], top;

ll k, ans[maxn];

bool used[maxn];



int main() {

    ios::sync_with_stdio(false);

    n = read();

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

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

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

    for (reg int i = 1; i <= m; i++) a[i] = read();

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

    for (reg int i = 1; i <= m; i++) swap(pos[a[i]], pos[a[i] + 1]);

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

        if (!used[i]) {

            top = 0;

            for (reg int j = i; !used[j]; j = pos[j]) Stack[++top] = j, used[j] = true;

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

                ans[Stack[j]] = d[Stack[(k + j - 1) % top + 1]];

        }

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

    return 0;

}


// Optimized solution to the same problem (faster):
#include<cstdio>

#include<algorithm>

#define int long long

const int N=200003;

int x[N],ans[N],g[N],n,m,k,used[N],siz;

signed main(){

	scanf("%lld",&n);

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

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

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

	for(int i,j=1;j<=m;j++)scanf("%lld",&i),std::swap(g[i],g[i+1]);

	for(int i=1,j,v;i<=n;i++)if(!used[i]){

	  siz=1;

	  for(j=g[i];j!=i;j=g[j])

		siz++;

	  j=i;

	  for(int id=1;id<=k%siz;id++)j=g[j];

	  ans[i]=x[j],used[j]=1;

	  for(j=g[j],v=g[i];!used[j];j=g[j],v=g[v])

		ans[v]=x[j],used[j]=1;

	}

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

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

#define ll long long

using namespace std;

const ll N=1e5+10;

ll n,m,k,p;

ll x[N],id[N],sta[N],ans[N],vis[N];

int main(){

	scanf("%lld",&n);

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

	for(ll i=n;i>=1;i--) x[i]-=x[i-1];

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

	for(ll i=1;i<=m;i++) scanf("%lld",&p),swap(id[p],id[p+1]);

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

		if(!vis[i]){

			ll cnt=0;

			for(ll j=i;!vis[j];j=id[j]) sta[++cnt]=j,vis[j]=1;

			for(ll j=1;j<=cnt;j++) ans[sta[j]]=x[sta[(j+k-1)%cnt+1]];

		}

	}

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

}

// Optimized solution to the same problem (faster):
#include<cstdio>

#include<algorithm>

#define int long long

const int N=200003;

int x[N],ans[N],g[N],n,m,k,used[N],siz;

signed main(){

	scanf("%lld",&n);

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

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

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

	for(int i,j=1;j<=m;j++)scanf("%lld",&i),std::swap(g[i],g[i+1]);

	for(int i=1,j,v;i<=n;i++)if(!used[i]){

	  siz=1;

	  for(j=g[i];j!=i;j=g[j])

		siz++;

	  j=i;

	  for(int id=1;id<=k%siz;id++)j=g[j];

	  ans[i]=x[j],used[j]=1;

	  for(j=g[j],v=g[i];!used[j];j=g[j],v=g[v])

		ans[v]=x[j],used[j]=1;

	}

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

	return 0;

}

// Fastest known solution for this problem: