Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- #define endl "\n"
- int main() {
- ios_base :: sync_with_stdio(false);
- //freopen("input.txt", "r", stdin);
- //freopen("output.txt", "w", stdout)
- int t, n;
- cin >> t;
- while(t--) {
- cin >> n;
- int a[n], deg_sum = 0;
- bool deg_error = false;
- for(int i = 0; i < n; i++) {
- cin >> a[i];
- if(a[i] > n-1) deg_error = true;
- deg_sum += a[i];
- }
- if(deg_sum % 2 == 0 && !deg_error) cout << "YES" << endl;
- else cout << "NO" << endl;
- }
- }
Add Comment
Please, Sign In to add comment