Untitled

 avatar
unknown
plain_text
a year ago
381 B
3
Indexable
#include <stdio.h>
#include <math.h>

int main()
{
    long long int a, b, c;
    long long int t;
    scanf("%lld", &t);
    for (int i = 0; i < t; i++)
    {
        scanf("%lld %lld %lld", &a, &b, &c);
        if (b % 3 == 1 && c % 3 == 1)
            printf("-1\n");
        else
            printf("%lld\n", a + ceil((b + c) / 3));
        }

    return 0;
}
Editor is loading...
Leave a Comment