fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. int t, n, x, even, odd;
  7. cin >> t;
  8.  
  9. for (int i = 1; i <= t; i++)
  10. {
  11. cin >> n;
  12.  
  13. n *= 2;
  14. even = odd = 0;
  15.  
  16. while (n--)
  17. {
  18. cin >> x;
  19. if (x & 1) odd++;
  20. else even++;
  21. }
  22.  
  23. cout << "Test case " << i << ": ";
  24. if (even != odd) cout << "No" << endl;
  25. else cout << "Yes" << endl;
  26. }
  27.  
  28. return 0;
  29. }
  30.  
Success #stdin #stdout 0.01s 5440KB
stdin
4
2
2  3  4  5
3
2  3  4  5  5  5
1
2  3
4
1  5  3  2  6  7  3  4
stdout
Test case 1: Yes
Test case 2: No
Test case 3: Yes
Test case 4: No