#include <iostream>
#include <string>
#include <cstring>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>
#include <map>
#include <bitset>
#include <queue>
#include <set>
#pragma comment(linker, "/STACK:102400000,102400000")
using namespace std;
#define LL long long
#define ULL unsigned long long
#define eps 1e-9
#define N (100000 + 10)
#define M (400)
#define pii pair<int,int>
#define MP make_pair
#define inf 0x3f3f3f3f
#define md (ll+rr>>1)
#define lson ll, md, ls
#define rson md + 1, rr, rs
#define ls i<<1
#define rs i<<1|1
#define Pi acos(-1.0)
#define mod 1000000007
int a[N];
int b[N];
int main() {
int T;
scanf("%d", &T);
while(T--) {
int n;
scanf("%d", &n);
int sum = 0;
int cnt = 0;
for(int i = 1; i <= n; ++i ){
scanf("%d", &a[i]);
if(a[i] & 1) b[++cnt] = a[i];
sum += a[i];
}
if(cnt == 0) {
printf("%d\n", sum);
continue;
}
printf("%d\n", (sum-cnt)/(2*cnt) * 2 + 1);
}
}
hdu 5744(水)
最新推荐文章于 2023-04-06 18:11:21 发布