P5550 Chino’s Sequence.

Background

None. I can’t write it anymore qwq.

Description

Chino is given $n$ numbers $a_1...a_n$, and two constants $s, m$. She will repeatedly perform $k$ rounds of operations on these $n$ numbers. Each round includes the following steps: 1. $\operatorname{swap}(a_s,a_m)$ (swap $a_s$ and $a_m$). 2. Shift all $n$ numbers forward by one position (the 1st number moves to the $n$-th position). Chino wants to know what these $n$ numbers are after $k$ rounds of operations. Orz yky,dyh,wjk,jjy,cxr,gsy,cpy,zcy,tyz,yy,hz,zhr,ygg.

Input Format

The first line contains four numbers: $n, s, m, k$. The next line contains $n$ numbers, representing $a_1, a_2...a_n$.

Output Format

Output one line with $n$ numbers, representing $a_1, a_2...a_n$.

Explanation/Hint

For $40\%$ of the testdata, $1 \leq k \leq 10^7$. For $100\%$ of the testdata, $1 \leq n \leq 80$, $1 \leq s, m \leq n$, $1 \leq k \leq 10^{18}$. All numbers fit in `long long`. Translated by ChatGPT 5