fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. int n,i;
  7. scanf("%d",&n);
  8. long long int temp;
  9. for(i=0;i<n;i++)
  10. {
  11. scanf("%lld",&temp);
  12. if(temp%2!=0)
  13. printf("%lld\n",temp);
  14. else
  15. {
  16. while(temp%2==0)
  17. {
  18. temp/=2;
  19. }
  20. printf("%lld\n",temp);
  21. }
  22. }
  23. return 0;
  24. }
Success #stdin #stdout 0s 15232KB
stdin
10
67
90
43
87
34
29
67
999
1332
1024
stdout
67
45
43
87
17
29
67
999
333
1