forked from rathoresrikant/HacktoberFestContribute
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMARM.cpp
More file actions
37 lines (30 loc) · 606 Bytes
/
MARM.cpp
File metadata and controls
37 lines (30 loc) · 606 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
const ll MAX =1e9+7;
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
ll t;
cin>>t;
while(t--)
{
ll n,k;
cin>>n>>k;
ll A[n];
for(ll i=0;i<n;i++)
cin>>A[i];
ll a,b;
for(ll i=0;i<=k-1;i++){
a=A[i%n];
b=A[n-(i%n)-1];
A[i%n]=a^b;
}
for(ll i=0;i<n;i++)
cout<<A[i]<<" ";
cout<<"\n";
}
return 0;
}