stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#pragma GCC optimize(3)

#include<iostream>

#include<cstdio>

#include<cstdlib>

#include<cmath>

#include<cstring>

#include<string>

#include<algorithm>

#include<vector>

#include<map>

#include<set>

#include<list>

#include<queue>

#include<stack>

#include<bitset>

#include<deque>

using namespace std;

#define ll long long

#define inf 0x3f3f3f3f

#define ri register int

#define il inline

#define fi first

#define se second

#define mp make_pair

#define pi pair<int,int>

#define mem0(x) memset((x),0,sizeof (x))

#define mem1(x) memset((x),0x3f,sizeof (x))

il char gc() {

	static const int BS = 1 << 22;

	static unsigned char buf[BS], *st, *ed;

	if (st == ed) ed = buf + fread(st = buf, 1, BS, stdin);

	return st == ed ? EOF : *st++;

}

#define gc getchar

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

	x = 0;

	bool f = 0;

	char c = gc();

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

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

		c = gc();

	}

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

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

		c = gc();

	}

	if (f) x = -x;

}

#undef gc

#define pb push_back

#define N 100010

#define M N

#define int ll

int v[M], u[M], nx[M];

int cnt, head[N];

il void add(int uu, int vv) {

	u[++cnt] = uu, v[cnt] = vv, nx[cnt] = head[uu];

	head[uu] = cnt;

}

int n, m, k;

double pos[N];

double de[N];

double ans[N];

int num[N], ys[N];

int cur;

int bel[N], rk[N];

vector<int>hv[N];

void dfs(int x, int k) {

	bel[x] = k;

	hv[k].pb(x);

	rk[x] = hv[k].size() - 1;

	for (ri i = head[x]; i; i = nx[i])

		if (!bel[v[i]]) dfs(v[i], k);

}

signed main() {

#ifndef ONLINE_JUDGE

	//freopen("in.in", "r", stdin);

#endif

	in(n);

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

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

		de[i] = pos[i] - pos[i - 1];

		num[i] = i;

	}

	in(m), in(k);

	for (ri i = 1, t; i <= m; ++i) {

		in(t);

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

	}

	for (ri i = 1; i <= n; ++i) ys[num[i]] = i;

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

		add(i, ys[i]);

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

		if (!bel[i]) {

			++cur;

			dfs(i, cur);

		}

	for (ri i = 1, t; i <= n; ++i) {

		t = hv[bel[i]][(rk[i] + k) % hv[bel[i]].size()];

		ans[t] = de[i];

	}

	double tmp = 0.0;

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

		tmp += ans[i];

		printf("%.9f\n", tmp);

	}

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 3.58617508368381x):
#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;

}
// Slower C++ solution:
#pragma GCC optimize(3)

#include<iostream>

#include<cstdio>

#include<cstdlib>

#include<cmath>

#include<cstring>

#include<string>

#include<algorithm>

#include<vector>

#include<map>

#include<set>

#include<list>

#include<queue>

#include<stack>

#include<bitset>

#include<deque>

using namespace std;

#define ll long long

#define inf 0x3f3f3f3f

#define ri register int

#define il inline

#define fi first

#define se second

#define mp make_pair

#define pi pair<int,int>

#define mem0(x) memset((x),0,sizeof (x))

#define mem1(x) memset((x),0x3f,sizeof (x))

il char gc() {

	static const int BS = 1 << 22;

	static unsigned char buf[BS], *st, *ed;

	if (st == ed) ed = buf + fread(st = buf, 1, BS, stdin);

	return st == ed ? EOF : *st++;

}

#define gc getchar

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

	x = 0;

	bool f = 0;

	char c = gc();

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

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

		c = gc();

	}

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

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

		c = gc();

	}

	if (f) x = -x;

}

#undef gc

#define pb push_back

#define N 100010

#define M N

#define int ll

int v[M], u[M], nx[M];

int cnt, head[N];

il void add(int uu, int vv) {

	u[++cnt] = uu, v[cnt] = vv, nx[cnt] = head[uu];

	head[uu] = cnt;

}

int n, m, k;

double pos[N];

double de[N];

double ans[N];

int num[N], ys[N];

int cur;

int bel[N], rk[N];

vector<int>hv[N];

void dfs(int x, int k) {

	bel[x] = k;

	hv[k].pb(x);

	rk[x] = hv[k].size() - 1;

	for (ri i = head[x]; i; i = nx[i])

		if (!bel[v[i]]) dfs(v[i], k);

}

signed main() {

#ifndef ONLINE_JUDGE

	//freopen("in.in", "r", stdin);

#endif

	in(n);

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

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

		de[i] = pos[i] - pos[i - 1];

		num[i] = i;

	}

	in(m), in(k);

	for (ri i = 1, t; i <= m; ++i) {

		in(t);

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

	}

	for (ri i = 1; i <= n; ++i) ys[num[i]] = i;

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

		add(i, ys[i]);

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

		if (!bel[i]) {

			++cur;

			dfs(i, cur);

		}

	for (ri i = 1, t; i <= n; ++i) {

		t = hv[bel[i]][(rk[i] + k) % hv[bel[i]].size()];

		ans[t] = de[i];

	}

	double tmp = 0.0;

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

		tmp += ans[i];

		printf("%.9f\n", tmp);

	}

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 3.5732016192889917x):
#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]);

}
// 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: 5.198268840594503x):
// 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;

}
// Slower C++ solution:
#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;

}

// Faster C++ solution for the same problem (measured speedup: 5.1981853727466545x):
// 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;

}
// Slower C++ solution:
#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]);

}


// Faster C++ solution for the same problem (measured speedup: 5.229075030998198x):
// 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;

}
// Slower C++ solution:
#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;

}

// Faster C++ solution for the same problem (measured speedup: 5.196535665276262x):
// 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;

}
// Slower C++ solution:
#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]);

}

// Faster C++ solution for the same problem (measured speedup: 5.217058775380009x):
// 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;

}
// Slower C++ solution:
#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;

}

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


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

}
// Slower C++ solution:
#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;

}

// Faster C++ solution for the same problem (measured speedup: 1.2445938950941364x):
#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;

}
// Slower C++ solution:
#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;

}

// Faster C++ solution for the same problem (measured speedup: 4.388507182500731x):
#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;

}