Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- using namespace std;
- int main() {
- int t;
- cin >> t;
- while(t--){
- int n;
- cin >> n;
- if(n%2==1){
- cout << 0 << endl;
- }else{
- int k=1,i,dem=0;
- for(k = 1; k<=n; k++){
- if(n%(int)pow(2,k)!=0){
- break;
- }
- }
- k = k - 1;
- int thuong = n / pow(2,k);
- for(i = 1; i<=thuong; i++){
- if(thuong%i==0){
- dem++;
- }
- }
- int ketqua = dem * k;
- cout << ketqua << endl;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement