fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. // your code goes here
  6. int t;
  7. cin>>t;
  8. while(t--)
  9. {
  10. int n;
  11. cin>>n;
  12. long long arr[n];
  13. long long sum=0;
  14. for(int i=0;i<n;i++)
  15. {
  16. cin>>arr[i];
  17. sum+=arr[i];
  18. }
  19. if(sum%2==0)
  20. {
  21. cout<<"YES"<<endl;
  22. }
  23. else
  24. cout<<"NO"<<endl;
  25. }
  26. return 0;
  27. }
Success #stdin #stdout 0s 4508KB
stdin
1
5
0 4 2 0 2
stdout
YES