#include using namespace std; #define FAST_IO (ios_base:: sync_with_stdio(false),cin.tie(NULL)); #define ll long long #define ull unsigned long long #define endl '\n' #define ff first #define ss second #define pb push_back #define all(x) x.begin(), x.end() #define sz(x) (int)(x).size() #define yes cout<<"YES"<>= 1; } return ans; } bool isPrime(ll n) { if(n <= 1) return false; for(ll i = 2; i*i <= n; i++) if(n % i == 0) return false; return true; } #ifndef ONLINE_JUDGE #define dbg(x...) cerr << #x << " : "; _print(x) #else #define dbg(...) #endif void __print(int x) {cerr << x;}void __print(long x) {cerr << x;} void __print(long long x){cerr << x;} void __print(unsigned x){cerr << x;} void __print(unsigned long x){cerr << x;} void __print(unsigned long long x){cerr << x;} void __print(float x){cerr << x;} void __print(double x){cerr << x;} void __print(long double x){cerr << x;} void __print(char x){cerr << x;} void __print(const char *x){cerr << x;} void __print(const string &x){cerr << x;} void __print(bool x){cerr << (x ? "true" : "false");} void _print() { cerr << "\n"; } template void __print(const A &x); template void __print(const pair &p); template void __print(const A &x) {bool f=1; cerr << '['; for (const auto &i : x) {cerr << (f ? "" : ","), __print(i); f = 0;} cerr << ']';} template void __print(const pair &p) {cerr << '('; __print(p.first); cerr << ','; __print(p.second); cerr << ')';} template void _print(const Head &H, const Tail &...T) { __print(H); if (sizeof...(T)) cerr << ", "; _print(T...);} ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// void solve() { int n,sum=0,flag=0; cin>>n; for(int i=0; i>x; if(x%3==1) flag=1; sum +=x; } dbg(sum); if(sum%3==0) cout<<0<> TC; while (TC--) solve(); }