Advertisement
Guest User

Untitled

a guest
Dec 15th, 2021
49
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3.  
  4.  
  5. int main()
  6. {
  7. int t;cin>>t;
  8. while(t--)
  9. {
  10. int x;cin>>x;
  11.  
  12. if(x%2!=0)
  13. {
  14. cout<<-1<<endl;
  15. }
  16. else
  17. {
  18. int a[x];
  19. for(int i = 0;i <= (x/2-1);i++ )
  20. {
  21.  
  22. a[i] = 1;
  23. }
  24.  
  25. for(int i = x/2;i <= x-1;i++ )
  26. {
  27.  
  28. a[i] = 0;
  29. }
  30.  
  31. for(int i = 0;i <= x-1;i++ )
  32. {
  33.  
  34. cout<<a[i];
  35. }
  36. }
  37. }
  38. return 0;
  39. }
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement