stablegradients/pie-gem5-bysrc huggingface dataset:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

#define all(v) ((v).begin()),((v).end())

#define ll long long

#define fastIO cout << fixed << setprecision(12), ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr)

double const EPS = 1e-12, PI = acos(-1);

const int N = 1e6 + 9, M = 5e3 + 9, OO = 1e9 + 7, MOD = 1e9 + 7;

const ll inf = 1e18;



bool la2[N];

int n, m, a;

ll mem[N];



ll dp(int step) {

  if(step == n)

    return 1;

  if(step > n)

    return 0;

  ll& ret = mem[step];

  if(~ret)

    return ret;

  ret = 0;

  if(!la2[step + 1])

    ret = ((ret % MOD) + (dp(step + 1) % MOD)) % MOD;

  if(!la2[step + 2])

    ret = ((ret % MOD) + (dp(step + 2) % MOD)) % MOD;

  return ret;

}



int main() {

  fastIO;

#ifdef LOCAL

  freopen("input.in", "rt", stdin);

#endif

  cin >> n >> m;

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

    cin >> a;

    la2[a] = 1;

  }

  memset(mem, -1, sizeof mem);

  cout << dp(0);

  return 0;

}

// Optimized solution to the same problem (faster):
#include <bits/stdc++.h>



#define rev(v) reverse(v.begin(), v.end());

#define mx(v) max_element(v.begin(), v.end());

#define mn(v) min_element(v.begin(), v.end()); 

#define fastio() ios_base::sync_with_stdio(0);cout.tie(0);cin.tie(0);srand(time(NULL));

#define mod 1000000007



//ffs = lsb, clz = l0's, ctz = r0's, popcount = 1's 

 //++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++

using namespace std;

 //++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++



typedef long long ll;

typedef long double ld;

typedef unsigned long long ull;



int main(){

    fastio();

    ll n,m ; cin >> n >> m;

    ll dp[n + 1];

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

        dp[i] = 0;

    }

    dp[0] = 1;

    dp[1] = 1;

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

        int x;  cin >> x;

        dp[x] = -1;

    } 

    

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

        if(dp[i] >= 0){

            if(dp[i-1] < 0  && dp[i-2] < 0 ){

                return cout << "0\n" , 0;

            }

            if(dp[i-1] < 0){

                dp[i-2] = dp[i-2] % mod;

                dp[i] = dp[i-2];

            }else if(dp[i-2] < 0){

                dp[i-1] = dp[i-1] % mod;

                dp[i] = dp[i-1];

            }else{

                dp[i-1] = dp[i-1] % mod;

                dp[i-2] = dp[i-2] % mod;

                dp[i] = dp[i - 1] + dp[i - 2];

            }

            dp[i] = dp[i] % mod;

        }

    }



    return cout << dp[n] % mod, 0 ;

}

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

#define in_range(x, y, r, c) (x < r && y < c && x >= 0 && y >= 0)

using namespace std;

const int mod = 1e9+7;

bool no[100100];

int memo[100100];



int ups(int v){

	if (v == 0) return 1;

	if (v < 1) return 0;

	if (no[v]) return 0;

	if (memo[v] != -1) return memo[v];

	return memo[v] = (ups(v-1) + ups(v-2))%mod;

}



int main(){

	int n, m, aux;

	cin >> n >> m;

	memset(no, false, sizeof no);

	memset(memo, -1, sizeof memo);

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

		cin >> aux;

		no[aux] = true;

	}

	cout << ups(n) << endl;

    return 0;

}

// Optimized solution to the same problem (faster):
#include <bits/stdc++.h>



#define rev(v) reverse(v.begin(), v.end());

#define mx(v) max_element(v.begin(), v.end());

#define mn(v) min_element(v.begin(), v.end()); 

#define fastio() ios_base::sync_with_stdio(0);cout.tie(0);cin.tie(0);srand(time(NULL));

#define mod 1000000007



//ffs = lsb, clz = l0's, ctz = r0's, popcount = 1's 

 //++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++

using namespace std;

 //++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++



typedef long long ll;

typedef long double ld;

typedef unsigned long long ull;



int main(){

    fastio();

    ll n,m ; cin >> n >> m;

    ll dp[n + 1];

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

        dp[i] = 0;

    }

    dp[0] = 1;

    dp[1] = 1;

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

        int x;  cin >> x;

        dp[x] = -1;

    } 

    

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

        if(dp[i] >= 0){

            if(dp[i-1] < 0  && dp[i-2] < 0 ){

                return cout << "0\n" , 0;

            }

            if(dp[i-1] < 0){

                dp[i-2] = dp[i-2] % mod;

                dp[i] = dp[i-2];

            }else if(dp[i-2] < 0){

                dp[i-1] = dp[i-1] % mod;

                dp[i] = dp[i-1];

            }else{

                dp[i-1] = dp[i-1] % mod;

                dp[i-2] = dp[i-2] % mod;

                dp[i] = dp[i - 1] + dp[i - 2];

            }

            dp[i] = dp[i] % mod;

        }

    }



    return cout << dp[n] % mod, 0 ;

}

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

using namespace std;

int n,m;

#define mod 1000000007

#define ll long long

vector<int> br;

vector<ll> DP;



ll dp(int i){

  if(i==n) return 1;

  if(i>n) return 0;

  if(br[i]==1) return 0;

  if(DP[i]!=-1) return DP[i];

  return DP[i]=(dp(i+1)+dp(i+2))%mod;

}



int main(){

  scanf("%d %d",&n,&m);

  br.resize(n+1,0);

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

    int a;

    scanf("%d",&a);

    br[a]=1;

  }



  DP.resize(n+1,-1);

  printf("%lld\n",dp(0));



  return 0;

}


// Optimized solution to the same problem (faster):
#include <stdio.h>

long long mod=1e9+7;

long long vis[100005],a[100005]={1,1,2};

int main()

{

    long long i,x,n,k;

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

    for(i=1; i<=k; i++)

    {

        scanf("%lld",&x);

        vis[x]=1;

    }

    if(vis[1]) a[1]=0;

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

    {

        if(vis[i]) a[i]=0;

        else a[i]=(a[i-1]%mod+a[i-2]%mod)%mod;

    }

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

    return 0;

}




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

#include<math.h>

using namespace std;

int n,m;

int broken[100005];

int memo[100005];

int o = (int)1e9+7;

int dp(int idx){

//	cout<<idx<<"\n";

	if(idx == n) return 1;

	if(memo[idx]!=-1) return memo[idx];

	int one = 0, two = 0;

	if(broken[idx+1]!=1){

		one = dp(idx+1);

	}

	if(broken[idx+2]!=1 && idx+2<=n){

		two = dp(idx+2);

	}

	return memo[idx] = ((one%o) +(two%o))%o;

}

int main(){

	int a;

	cin>>n>>m;

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

		cin>>a;

		broken[a] = 1;

	}

	for(int i = 0;i<=n;i++)memo[i] = -1;

	cout<<dp(0)%o<<"\n";

	return 0;

}

// Optimized solution to the same problem (faster):
#include <stdio.h>

long long mod=1e9+7;

long long vis[100005],a[100005]={1,1,2};

int main()

{

    long long i,x,n,k;

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

    for(i=1; i<=k; i++)

    {

        scanf("%lld",&x);

        vis[x]=1;

    }

    if(vis[1]) a[1]=0;

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

    {

        if(vis[i]) a[i]=0;

        else a[i]=(a[i-1]%mod+a[i-2]%mod)%mod;

    }

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

    return 0;

}




// Fastest known solution for this problem:
// Original C++ solution (slower):
//

// Created by Mahmoud Rashad on 11/27/19.

//



#include <bits/stdc++.h>





using namespace std;



typedef vector<int> vi;

typedef pair<int, int> ii;

typedef vector<pair<ii, ii>> vii;



const int Mod = (int)1e9 + 7;



int mul(int a, int b) {

    return 1LL * a * b % Mod;

}



const int MAXN = 100005;

int n;

int memo[MAXN];

set<int> st;

int count(int step) {

    if (step == n)

        return 1;

    if (step > n)

        return 0;

    if (st.find(step) != st.end())

        return 0;

    int &ret = memo[step];

    if (~ret)

        return ret;

    ret = 0;

    ret += count(step + 1);

    ret %= Mod;

    ret += count(step + 2);

    ret %= Mod;

    return ret;

}



int main() {

#ifndef ONLINE_JUDGE

//    freopen("input.txt", "r", stdin);

//    freopen("output.out", "w", stdout);

#endif

    ios::sync_with_stdio(false), cin.tie(0), cout.tie(0), cout.precision(10), cout << fixed;



    int m;

    cin >> n >> m;

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

        int x;

        cin >> x;

        st.insert(x);

    }



    memset(memo, -1, sizeof memo);

    cout << count(0) << '\n';

}

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


#include <iostream>

#include <algorithm>



using namespace std;



#define MOD 1000000007



int main() {

    int N, M; cin >> N >> M; int A, visited[N+1] = {}; long long fib[N+1] = {1};

    for (int i = 1; i <= M; i++) cin >> A, visited[A] = 1;

    if (not visited[1]) fib[1] = 1;

    for (int i = 2; i <= N; i++) if (not visited[i]) fib[i] = (fib[i-1]+fib[i-2]) % MOD;

    cout << fib[N] << endl;

    return 0;

}


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

using namespace std;



const int MOD = 1000000007;

bool is_safe[100010];

int dp[100010];



int rec(int i) {

    if(dp[i] != -1) return dp[i];

    if(i == 0) return 1;

    int res = 0;

    if(is_safe[i-1]) res += rec(i-1);

    if(is_safe[i-2]) res += rec(i-2);

    return dp[i] = res % MOD;

}



int main() {

    int N, M; cin >> N >> M;

    for(int i = 0; i < 100010; ++i) {

        is_safe[i] = true;

        dp[i] = -1;

    }

    

    for(int i = 0; i < M; ++i) {

        int a; cin >> a;

        is_safe[a] = false;

    }

    

    cout << rec(N) << endl;

}


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

#include <vector>

using namespace std;



const int MOD = 1000000007;



int main() {

    int N, M; cin >> N >> M;

    vector<bool> is_safe(N+1, true);

    for(int i = 0; i < M; ++i) {

        int a; cin >> a;

        is_safe[a] = false;

    }

    

    vector<int> dp(N+2, 0);

    dp[0] = 1;

    for(int i = 0; i < N; ++i) {

        if(is_safe[i+1] && is_safe[i]) dp[i+1] += dp[i], dp[i+1] %= MOD;

        if(is_safe[i+2] && is_safe[i]) dp[i+2] += dp[i], dp[i+2] %= MOD;

    }

    

    cout << dp[N] << endl;

}


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

#include <cstdio>

#include <cstring>

#include <cstdlib>

#include <iostream>

#include <algorithm>

using namespace std;

int lt,ls,i,j,tt,ans=0x7fffffff;

char s[1010],t[1010];

int main () {

	scanf ("%s%s",s+1,t+1);

	ls=strlen (s+1);

	lt=strlen (t+1); 

	for (i=1;i<=ls-lt+1;i++) {

        tt=0;

		for (j=i;j<=i+lt-1;j++) {

			if (s[j]!=t[j-i+1]) {

				tt++;

			}

		}

		ans=min (tt,ans); 

	}

	printf ("%d\n",ans);

}

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

#include <cstring>

#define min(a,b) ((a)<(b)?(a):(b))

char s[1003],t[1003];

int lens,lent,ans=1<<30,sum;

int main(){

    scanf("%s%s",s,t);

    lens=strlen(s),lent=strlen(t);

    for(int i=0;i<lens-lent+1;i++){

        sum=0;

        for(int j=0;j<lent;j++) if(s[i+j]!=t[j]) ++sum;

        ans=min(ans,sum);

    }

    printf("%d\n",ans);

    return 0;

}

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

using namespace std;

using ll = long long;

using vll = vector<ll>;

#define all(x) (x).begin(),(x).end()

template <typename T>

std::ostream& operator<<(std::ostream&s,const vector<T>&xs){

    s<<'[';for(size_t i=0;i<xs.size();++i){if(i)s<<' ';s<<xs[i];}return s<<']';

}



vll permmult(const vll& P, const vll& Q){

    ll n=P.size();

    vll PQ(n);

    for(ll i=0;i<n;++i)PQ[i]=Q[P[i]];

    return PQ;

}



vll permpow(vll P, ll k){

    ll n=P.size();

    vll result(n);

    iota(all(result),0);

    for(;k;k/=2){

        if(k%2)result=permmult(result,P);

        P=permmult(P,P);

    }

    return result;

}



vll permpow2(const vll& P, ll k) {

    ll n=P.size();

    vll Q(n);

    vll done(n);

    vll cycle;

    for(ll i=0;i<n;++i)if(!done[i]){

        done[i]=true;

        cycle.clear();

        cycle.push_back(i);

        for(ll j=P[i];j!=i;j=P[j]){

            cycle.push_back(j);

            done[j]=true;

        }

        ll m=cycle.size();

        for(ll j=0;j<m;++j)Q[P[cycle[j]]] = cycle[(j+k+1)%m];

    }

    return Q;

}



vll perminv(const vll& P) {

    ll n=P.size();

    vll Q(n);

    for(ll i=0;i<n;++i)Q[P[i]]=i;

    return Q;

}



int main() {

    ios::sync_with_stdio(false);



    if (0) {

        //vll perm{0,1, 3,2,  5,6,4,  10,7,8,9};

        vll perm{4,1,2,0,3};

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

            cout<<"i="<<i<<", "<<permpow(perm,i)<<" "<<permpow2(perm,i)<<'\n';

        }

        return 0;

    }



    ll N;cin>>N;

    vll xs(N);for(ll&x:xs)cin>>x;

    ll M,K;cin>>M>>K;

    vll P(N-1);iota(all(P),0);

    for(int i=0,a;i<M&&cin>>a;++i)swap(P[a-2],P[a-1]);

    //P=permpow2(P,K);

    P=permpow(P,K);

    //P=perminv(P);

    vll ds(N-1);

    for(ll i=1;i<N;++i)ds[i-1]=xs[i]-xs[i-1];

    cout<<xs[0]<<".0\n";

    for(ll x=xs[0],i=0;i+1<N;++i){

        x+=ds[P[i]];

        cout<<x<<".0\n";

    }

}


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

#include<algorithm>

using namespace std;

const int MAXN = 100000;

typedef long long ll;

int N, M; ll K;

int x[MAXN + 5];

int a[MAXN + 5], b[MAXN + 5], res[MAXN + 5];

void Pow(ll p) {

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

		res[i] = i;

	while( p ) {

		if( p & 1 ) {

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

				res[i] = a[res[i]];

		}

		p >>= 1;

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

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

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

			a[i] = b[i];

	}

}

int main() {

	scanf("%d", &N);

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

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

	for(int i=N-1;i>0;i--)

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

	scanf("%d%lld", &M, &K);

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

		a[i] = i;

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

		int k;

		scanf("%d", &k);

		swap(a[k-1], a[k]);

	}

	Pow(K);

	ll nw = x[0];

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

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

		nw = nw + x[res[i]];

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

	}

}

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

using namespace std;

const int N=1e5+10;

typedef long long ll;

int gi() {

    int x=0,o=1;char ch=getchar();

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

    if(ch=='-') o=-1,ch=getchar();

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

    return x*o;

}

int n,m,id[N],st[N],top=0;

ll a[N],ans[N],k;

bool vis[N];

int main() {

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

	//freopen("rabbit.out","w",stdout);

    cin>>n;

    for(int i=1;i<=n;i++) a[i]=gi(),id[i]=i;

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

    cin>>m>>k;

    for(int i=1,x;i<=m;i++) x=gi(),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]);

    return 0;

}

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

#include<algorithm>

using namespace std;

const int MAXN = 100000;

typedef long long ll;

int N, M; ll K;

int x[MAXN + 5];

int a[MAXN + 5], b[MAXN + 5], res[MAXN + 5];

void Pow(ll p) {

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

		res[i] = i;

	while( p ) {

		if( p & 1 ) {

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

				res[i] = a[res[i]];

		}

		p >>= 1;

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

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

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

			a[i] = b[i];

	}

}

int main() {

	scanf("%d", &N);

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

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

	for(int i=N-1;i>0;i--)

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

	scanf("%d%lld", &M, &K);

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

		a[i] = i;

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

		int k;

		scanf("%d", &k);

		swap(a[k-1], a[k]);

	}

	Pow(K);

	ll nw = x[0];

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

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

		nw = nw + x[res[i]];

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

	}

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
// LNU_Algotesters

#include <iostream>

#include <sstream>

#include <iomanip>

#include <cstdio>

#include <cstdlib>

#include <cmath>

#include <cctype>

#include <cstring>

#include <vector>

#include <list>

#include <queue>

#include <deque>

#include <stack>

#include <map>

#include <set>

#include <algorithm>

#include <iterator>

#include <bitset>

#include <ctime>

#include <fstream>

#include <complex>



using namespace std;



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

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

#define ITER(it,a) for (__typeof(a.begin()) it = a.begin(); it != a.end(); it++)

#define FILL(a,value) memset(a, value, sizeof(a))



#define SZ(a) (int)a.size()

#define ALL(a) a.begin(), a.end()

#define PB push_back

#define MP make_pair



typedef long long LL;

typedef vector<int> VI;

typedef pair<int, int> PII;



const double PI = acos(-1.0);

const int INF = 1000 * 1000 * 1000 + 7;

const LL LINF = INF * (LL) INF;

const int MAX = 100 * 1000 + 47;



int X[MAX];



VI mult(VI &A, VI &B)

{

    VI res(SZ(A));

    FOR(i, 0, SZ(A))

        res[i] = B[A[i]];

    return res;

};





VI BP(VI& P, LL n)

{

    VI res;

    FOR(i, 0, SZ(P))res.PB(i);

    while(n)

    {

        if (n & 1)res = mult(res, P);

        P = mult(P, P);

        n >>= 1;

    }

    return res;

}



int main()

{

    int n;

    scanf("%d", &n);

    FOR(i, 0, n)scanf("%d", X + i);

    int m;

    LL k;

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

    VI P;

    FOR(i, 0, n-1)

        P.PB(i);

    FOR(i, 0, m)

    {

        int x;

        scanf("%d", &x);

        --x;

        swap(P[x], P[x-1]);

    }

    //cout << m << endl << endl;

    P = BP(P, k);

    LL cur = X[0];

    FOR(i, 0, n)

    {

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

        if (i < SZ(P))cur += X[P[i] + 1] - X[P[i]];

    }

}




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

#include<algorithm>

#include<cstring>

#define MN 100005

using namespace std;

int n,m,c[MN],tmp[MN];

long long a[MN],v[MN],k,ans[MN],sum;

bool vis[MN];

int main(){

	scanf("%d",&n);int x;

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

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

		v[i]=a[i]-a[i-1],c[i]=i;

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

	for(int i=1;i<=m;i++)scanf("%d",&x),swap(c[x],c[x+1]);

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

		for(j=i;!vis[j];j=c[j])vis[j]=1,tmp[++tt]=j;

		for(j=1;j<=tt;j++)ans[tmp[j]]=v[tmp[(j+k-1)%tt+1]];

	}

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

}




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

#include<algorithm>

#include<cmath>

#include<vector>

#define SF scanf

#define PF printf

#define MAXN 100010

using namespace std;

typedef long long ll;

ll k;

int n,m,t;

int gt[MAXN];

ll a[MAXN],pre[MAXN],ans[MAXN];

vector<int> num;

bool vis[MAXN];

void got(int x){

	vis[x]=1;

	if(num.size()>=1&&x==num[0])

		return ;

	num.push_back(x);

	got(gt[x]);

}

int main(){

	SF("%d",&n);	

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

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

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

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

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

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

		gt[i]=i;

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

		SF("%d",&t);	

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

	}

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

		if(vis[i]!=0)

			continue;

		got(i);

		int len=num.size();

		ll k1=k%len;

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

			ans[num[j]]=pre[num[(j+k1)%len]];

		num.clear();

	}

	ll sum=0;

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

		sum+=ans[i];

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

	}

}

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

#include<algorithm>

using namespace std;

const int MAXN = 100000;

typedef long long ll;

ll x[MAXN + 5], d[MAXN + 5];

int a[MAXN + 5]; bool tag[MAXN + 5];

int b[MAXN + 5], ans[MAXN + 5];

int main() {

	int N, M; ll K;

	scanf("%d", &N);

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

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

		if( i != 1 ) d[i-1] = x[i] - x[i-1];

	}

	scanf("%d%lld", &M, &K);

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

		a[i] = i;

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

		int x;

		scanf("%d", &x);

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

	}

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

		if( tag[i] ) continue;

		int p = i, siz = 0;

		do {

			tag[p] = true;

			b[siz++] = p;

			p = a[p];

		}while( p != i );

		int q = 0;

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

			ans[b[j]] = b[(j+K)%siz];

		}

	}

	ll nw = x[1];

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

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

		if( i != N ) nw += d[ans[i]];

	}

}

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

#include<cstring>

#include<algorithm>

#include<vector>

#define MAXN 100000

using namespace std;

typedef long long LL;

int n,m;

LL k;

LL x[MAXN+5];

int ord[MAXN+5];

int ord2[MAXN+5];

LL ans[MAXN+5],fin[MAXN+5];

bool vis[MAXN+5];

vector<int> ned;

int main()

{

	scanf("%d",&n);

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

	{

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

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

	}

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

	int p;

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

	{

		scanf("%d",&p);

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

	}

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

	{

		p=i;

		ned.clear();

		while(vis[p]==false)

		{

			vis[p]=true;

			ned.push_back(p);

			p=ord[p];

		}

		for(int j=0;j<(int)ned.size();j++)

			ord2[ned[j]]=ned[(1LL*j+1LL*k)%(LL)ned.size()];

	}

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

		fin[i]=ans[ord2[i]];

	LL sum=0;

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

	{

		sum+=fin[i];

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

	}

	return 0;

}

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

#include<algorithm>

using namespace std;

const int MAXN = 100000;

typedef long long ll;

ll x[MAXN + 5], d[MAXN + 5];

int a[MAXN + 5]; bool tag[MAXN + 5];

int b[MAXN + 5], ans[MAXN + 5];

int main() {

	int N, M; ll K;

	scanf("%d", &N);

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

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

		if( i != 1 ) d[i-1] = x[i] - x[i-1];

	}

	scanf("%d%lld", &M, &K);

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

		a[i] = i;

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

		int x;

		scanf("%d", &x);

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

	}

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

		if( tag[i] ) continue;

		int p = i, siz = 0;

		do {

			tag[p] = true;

			b[siz++] = p;

			p = a[p];

		}while( p != i );

		int q = 0;

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

			ans[b[j]] = b[(j+K)%siz];

		}

	}

	ll nw = x[1];

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

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

		if( i != N ) nw += d[ans[i]];

	}

}

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

	}

}

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

// Fastest known solution for this problem: