#include #include #include #include #include #include #include char* canConstruct(int a_size, int* a) { int temp=0; char* result; for(int i=0; i< a_size; i++) temp+=a[i]; int c=temp%3; if(c==0) result="Yes"; else result="No"; // Return "Yes" or "No" denoting whether you can construct the required number. return result; } int main() { int t; scanf("%i", &t); for(int a0 = 0; a0 < t; a0++){ int n; scanf("%i", &n); int *a = malloc(sizeof(int) * n); for (int a_i = 0; a_i < n; a_i++) { scanf("%i",&a[a_i]); } int result_size; char* result = canConstruct(n, a); printf("%s\n", result); } return 0; }