stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#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;

}

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

#include <cstdio>

#include <cmath>

#define rep(i,a,b) for(int i=a;i<=b;i++)

#define per(i,a,b) for(int i=a;i>=b;i--)

using namespace std;

const int N=2e5+5;

long long a[N],n,m,k,vis[N],b[N],cnt,lop[N],ans[N],res[N];

int main(){

	scanf("%lld",&n);

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

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

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

	rep(i,1,m){

		int R;

		scanf("%d",&R);

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

	}

	rep(i,1,n){

		if(vis[i]) continue;

		lop[cnt=1]=i;

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

			vis[pos]=1;

			lop[++cnt]=pos;

		}

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

	}

	rep(i,1,n) res[i]=a[ans[i]];

	rep(i,1,n) printf("%lld.0\n",res[i]+=res[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: 22.726025876755507x):
#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;

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

}

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

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

}


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

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

}

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

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

using namespace std;



typedef long long ll;



bool vis[100050];

ll w[100050], nxt[100050], que[100050], output[100050];



int main(){

	int n, m;

	scanf("%d", &n);

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

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

	ll k;

	ll a;

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

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

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

		if(!vis[i]) {

			int now = i, cnt = 0;

			while(!vis[now]){

				vis[now] = 1;

				que[++cnt] = now;

				now = nxt[now];

			}

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

				ll t = (0ll+j+k-2)%cnt+1;

				output[que[j]] = w[nxt[que[t]]];

			}

		}

	}

	ll p = 0;

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

}

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

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

using namespace std;

typedef long long LL;

const int N=1e5+7;

LL jmp,a,k,n,m,x[N],y[N],p[N],g[N],siz[N],tot,cnt,sum;

bitset <N> vis;

int main()

{

	scanf("%lld",&n);

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

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

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

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

	{

		scanf("%lld",&a);

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

	}

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

	{

		++cnt;int res=i;

		while(!vis[res])

			g[res]=cnt,vis[res]=1,res=p[res],++siz[cnt];

	}

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

	{

		jmp=k%siz[g[i]];

		int res=i;

		if(jmp)while(jmp--)res=p[res];

		sum+=y[res];

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

	}

} 

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

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

#include<cstdio>

#include<cstdlib>

#include<algorithm>

#include<cmath>

#include<queue>

using namespace std;

const int maxn = 1e6+7;

typedef long long ll;





ll n,m,pos[maxn],k,ans[maxn];

ll a[maxn],b[maxn],st[maxn];

ll move[maxn],vis[maxn];







int main()

{

	scanf("%lld",&n);

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

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

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

		b[i]=pos[i]-pos[i-1],a[i]=i;

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

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

	{

		ll x;

		scanf("%lld",&x);

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

	}

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

	{

		if(vis[t])continue;

		int round = 0;

		for(int i=t;!vis[i];i=a[i])vis[i]=1,st[++round]=i;

		for(int i=1;i<=round;i++) ans[st[i]] = b[ st[(i+k-1)%round +1]];

	}

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

	{

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

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

	}

	return 0;

}

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

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

#define fo(i,l,r) for(int i=l;i<=r;i++)

#define of(i,l,r) for(int i=l;i>=r;i--)

#define fe(i,u) for(int i=head[u];i;i=e[i].next)

#define el putchar('\n')

#define ta putchar('	')

using namespace std;

typedef long long ll;

typedef pair<int,int> pii;

inline void open(const char *s)

{

	#ifndef ONLINE_JUDGE

	char str[20];

	sprintf(str,"%s.in",s);

	freopen(str,"r",stdin);

//	sprintf(str,"%s.out",s);

//	freopen(str,"w",stdout);

	#endif

}

inline ll rd()

{

	static ll x,f;

	x=0;f=1;

	char ch=getchar();

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

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

	return f>0?x:-x;

}

const int N=100010;

int n,a[N],p[N],f[N];

ll b[N];

bool vis[N];



int main()

{

	n=rd();

	fo(i,1,n){

		a[i]=rd();

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

		f[i]=p[i]=i;

	}

	int m=rd();ll K=rd();

	fo(i,1,m){

		int x=rd();

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

	}

	fo(x,2,n)if(!vis[x]){

		int u=x;

		static vector<int>vec;

		vec.clear();

		for(;!vis[u];u=p[u])vec.push_back(u),vis[u]=1;

		int siz=vec.size();

		fo(i,0,siz-1)f[vec[i]]=vec[(i+K%siz)%siz];

	}

	ll hh=0;

	fo(i,1,n)printf("%lld.0\n",hh+=b[f[i]]);

	return 0;

}


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

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

#include <cstdio>

#include <cmath>

#define rep(i,a,b) for(int i=a;i<=b;i++)

#define per(i,a,b) for(int i=a;i>=b;i--)

using namespace std;

const int N=2e5+5;

long long a[N],n,m,k,vis[N],b[N],cnt,lop[N],ans[N],res[N];

int main(){

	scanf("%lld",&n);

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

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

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

	rep(i,1,m){

		int R;

		scanf("%d",&R);

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

	}

	rep(i,1,n){

		if(vis[i]) continue;

		lop[cnt=1]=i;

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

			vis[pos]=1;

			lop[++cnt]=pos;

		}

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

	}

	rep(i,1,n) res[i]=a[ans[i]];

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

	return 0;

}


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

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

#include <ext/pb_ds/assoc_container.hpp>

#include <ext/pb_ds/tree_policy.hpp>

 

using namespace std;

using namespace __gnu_pbds;

 

#define fi first

#define se second

#define mp make_pair

#define pb push_back

#define fbo find_by_order

#define ook order_of_key

 

typedef long long ll;

typedef pair<ll,ll> ii;

typedef vector<int> vi;

typedef long double ld; 

typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;

typedef set<int>::iterator sit;

typedef map<int,int>::iterator mit;

typedef vector<int>::iterator vit;



void p(ld ans)

{

	cout << fixed << setprecision(12) << ans << '\n';

}



ll x[100001];

int r[100001];

ll d[100001];

vi perm;

const int LG = 61;

int st[LG][100001];



int getval(int x, ll k)

{

	int pos = x;

	for(int i = 0; i < LG; i++)

	{

		if(k&(1LL<<i))

		{

			pos = st[i][pos];

		}	

	}

	return pos;

}



int main()

{

	ios_base::sync_with_stdio(0); cin.tie(0);

	int n; cin >> n;

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

	ll m, k; cin >> m >> k;

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

	{

		cin >> r[i];

		r[i]--;

	}

	d[0] = 0;

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

	{

		d[i] = x[i] - x[i-1];

	}

	for(int i = 0; i < n; i++) perm.pb(i);

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

	{

		swap(perm[r[i]], perm[r[i]+1]); //check

	}

	vi perm2(n);

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

	{

		perm2[perm[i]] = i;

	}

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

	{

		st[0][i] = perm2[i];

	}

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

	{

		for(int j = 0; j < n; j++)

		{

			st[i][j] = st[i-1][st[i-1][j]];

		}

	}

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

	{

		int pos = getval(i, k);

		perm2[pos] = i;

	}

	ld sum = ld(x[0]);

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

	{

		sum += ld(d[perm2[i]]);

		p(ld(sum));

	}

}


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

#define MAXN 100006

#include<algorithm>

using namespace std;

int n,m,id[MAXN],st[MAXN],top;

long long a[MAXN],ans[MAXN],k;

bool vis[MAXN];

int main()

{

	scanf("%d",&n);

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

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

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

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

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

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

		scanf("%d",&x),swap(id[x],id[x+1]);

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

		if(!vis[i])

		{

			top=0;

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

				st[++top]=j,vis[j]=1;

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

				ans[st[j]]=a[st[(k+j-1)%top+1]];

		}

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

	{

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

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

	}

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

//#include <ext/pb_ds/assoc_container.hpp>

//#include <ext/pb_ds/tree_policy.hpp>

//using namespace __gnu_pbds;

//#define eps 1e-8

//#define eq(x,y) (fabs((x)-(y)) < eps)

using namespace std;

typedef long long ll;

typedef long double ld;

typedef pair<int,int>pii;

const ll mod = 998244353;

long double PI = acosl(-1);

const ll infl = 3e18+10;

const int inf = 1e9+10;

const int nmax = 2e5+5;

const int MAXLG = log2(nmax)+1;

//mt19937 rng(chrono::system_clock::now().time_since_epoch().count());

//typedef tree< int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ost;



vector<int>g[nmax];

bool vis[nmax];

vector<int>serial;



void dfs(int u){

    if(vis[u]) return;

    vis[u] = true;

    serial.push_back(u);

    dfs(g[u][0]);

}



int main(){

    ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);



    int n;

    cin>>n;

    vector<int>v(n);

    vector<int>dif(n);

    for(int &x : v) cin>>x;

    for(int i=1; i<n; i++) dif[i] = v[i] - v[i-1];

    int m;

    ll k;

    cin>>m>>k;

    vector<int>permu(n);

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

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

        int pos;

        cin>>pos;

        swap(permu[pos], permu[pos-1]);

    }

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

        g[ permu[i] ].push_back(i);

    }

    vector<int>koigese(n);

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

        if(!vis[i]){

            dfs(i);

            int sz = serial.size();

            for(int j=0; j<sz; j++){

                int u = serial[j];

                koigese[u] = serial[ (k+j)%sz ];

            }

            serial.clear();

        }

    }

    vector<int>dif2(n);

    for(int i=1; i<n; i++) dif2[ koigese[i] ] = dif[i];



    vector<ll>ans = {v[0]};

    for(int i=1; i<n; i++) ans.push_back(ans.back() + dif2[i]);



    for(auto z : ans)

        cout<<z<<"\n";



}

/*

*/


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

#include <cstdio>

#include <algorithm>

#include <cstring>

using namespace std;

long long n, m, k, x[100001], a[100001], b[100001], to[100001], cir[100001], ans[100001];

bool vis[100001];

int main(int argc, char const *argv[])

{

    scanf("%lld", &n);

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

    {

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

        b[i] = x[i] - x[i - 1];

        to[i] = i;

    }

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

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

    {

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

        swap(to[a[i]], to[a[i] + 1]);

    }

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

    {

        if (!vis[i])

        {

            int cnt = 0;

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

            {

                cir[++cnt] = j;

                vis[j] = 1;

            }

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

            {

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

            }

        }

    }

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

    {

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

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

    }

    return 0;

}