fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. #define ll long long int
  4. #define ft ios_base ::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);ll za;cin>>za;while(za--)
  5. #define az(ni) for(ll i=0;i<ni;i++)
  6. #define oc(noc,rt,laf) (noc)?rt:laf;
  7. #define co(con,tr,fal) cout<<((con)?tr:fal);
  8. #define new cout<<"\n";
  9. #define re return 0;
  10. int main(){
  11. ft{
  12. ll n,b,c; cin>>n>>b>>c; ll a[n];
  13. az(n){
  14. cin>>a[i];
  15. }
  16. sort(a,a+n);
  17. while(c--){
  18. a[0]^=b;
  19. sort(a,a+n);
  20. }
  21. az(n){
  22. cout<<a[i]<<" ";
  23. }
  24. new
  25. }
  26. re
  27. }
Success #stdin #stdout 0.01s 5364KB
stdin
3
1 6 99
9
3 7 44
1 2 3
5 20 6
5 10 15 20 25
stdout
15 
3 5 6 
5 20 25 27 30