$O(t)$
#include<cstdio> #include<algorithm> using namespace std; int t, a, b, c, d, x, y, z, w; int main() { scanf("%d", &t); while (t--) scanf("%d %d %d %d %d %d %d %d", &a, &b, &c, &d, &x, &y, &z, &w), printf("%d\n", max(a + x, 1) + 5 * max(b + y, 1) + 2 * max(c + z, 0) + 2 * (d + w)); return 0; }
댓글 없음 :
댓글 쓰기