#482
Bronze I
Swapity Swap
시간 제한
2s
메모리 제한
1024MB
제출
0
정답
0
맞힌 사람
0
정답 비율
0.0%

문제

Farmer John's NN cows (1N1001\le N\le 100) are standing in a line. The iith cow from the left has label ii, for each 1iN1\le i\le N.

Farmer John has come up with a new morning exercise routine for the cows. He tells them to repeat the following two-step process exactly KK (1K1091\le K\le 10^9) times:

The sequence of cows currently in positions A1A2A_1 \ldots A_2 from the left reverse their order (1A1<A2N1\le A_1<A_2\le N).Then, the sequence of cows currently in positions B1B2B_1 \ldots B_2 from the left reverse their order (1B1<B2N1\le B_1<B_2\le N).

After the cows have repeated this process exactly KK times, please output the label of the iith cow from the left for each 1iN1\le i\le N.

SCORING: Test cases 2-3 satisfy K100K\le 100.Test cases 4-13 satisfy no additional constraints.

입력

The first line of input contains NN and KK. The second line contains A1A_1 and A2A_2, and the third contains B1B_1 and B2B_2.

출력

On the iith line of output, print the label of the iith cow from the left at the end of the exercise routine.

예제 입력 1

7 2
2 5
3 7

예제 출력 1

1
2
4
3
5
7
6
코드 제출

코드를 제출하려면 로그인이 필요합니다.

로그인
내 제출
제출 내역이 없습니다.
맞은 사람
아직 맞은 사람이 없습니다.
난이도 투표
Bronze I1명 투표· 약 1개월 전
로그인 후 AC 받으면 투표할 수 있습니다.
전체 제출
제출 내역이 없습니다.