fork download
  1. #include <iostream>
  2. #include<bits/stdc++.h>
  3. using namespace std;
  4.  
  5. int main() {
  6. int t;
  7. cin>>t;
  8. while(t--)
  9. {
  10. int n,b,c,i,j,d=0,e=0,f=0;
  11.  
  12. cin>>n>>b>>c;
  13. int arr[n];
  14. for(i=0;i<n;i++)
  15. {
  16. cin>>arr[i];
  17. }
  18. while(c--){
  19. e=(d^b);
  20. f=(arr[i]^b);
  21. d=f;
  22.  
  23. }
  24. cout<<e<<" ";
  25. }
  26. return 0;
  27. }
Success #stdin #stdout 0.01s 5520KB
stdin
1
5 20 6
5 10 15 20 25
stdout
32765