Problem. An island has red, green and blue chameleons. When two of different colours meet, both change to the third colour. Can all become blue?

Answer: yes iff and at least two colours are present (or already).

bool allBecome(long long a, long long b, long long c) {   // a, b: counts of the other two colours, c: target colour
    int nonzero = (a > 0) + (b > 0) + (c > 0);
    if (a == 0 && b == 0) return true;
    return (a - b) % 3 == 0 && nonzero >= 2;
}