forked from Sam071100/CodeForces-Solutions
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathodd_gcd.cpp
More file actions
41 lines (38 loc) · 694 Bytes
/
odd_gcd.cpp
File metadata and controls
41 lines (38 loc) · 694 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//Adarsh Priyadarshi
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define min(a,b) ((a<b)?a:b)
#define max(a,b) ((a>b)?a:b)
void solve(){
ll n;cin>>n;
ll a[n];
ll sum=0;
ll c=0;
vector<ll> v;
for(ll i=0;i<n;i++){
cin>>a[i];
sum=sum+a[i];
}
if(sum%2!=0)cout<<0<<endl;
else{
for(ll i=0;i<n;i++){
while(a[i]%2==0){
a[i]=a[i]/2;
c++;
}
v.push_back(c);
c=0;
}
sort(v.begin(),v.end());
cout<<v[0]<<endl;
}
}
int main(){
int t;
cin>>t;
while(t--){
solve();
}
return 0;
}