#include<bits/stdc++.h>
using namespace std; int main(){
int T, n, a;scanf("%d",&T);
while(T --){
scanf("%d",&n);
int odd = , even = ;
for(int i = ; i < n; i ++){
scanf("%d",&a);
odd += a % ;
even += a - (a & );
}
if(odd == ){
printf("%d\n",even);
continue;
}
even -= even % odd;
printf("%d\n",even/odd - ((even/odd) & ) + );
}
return ;
}
相关文章
- 04-12Known Notation ZOJ - 3829 (后缀表达式,贪心)
- 04-12CF 628C --- Bear and String Distance --- 简单贪心
- 04-12uva 1149:Bin Packing(贪心)
- 04-12AcWing 143 最大异或对(贪心,trie)
- 04-12poj 3069 Saruman's Army 贪心模拟
- 04-12题解:Saruman's Army(贪心)
- 04-12贪心法-------Saruman's army
- 04-12cf23C Oranges and Apples(很好的贪心题)
- 04-12leetcode 406 根据身高重建队列 贪心
- 04-12【贪心】452. 用最少数量的箭引爆气球