Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int couter;
- cin>>couter;
- while(couter--){
- int n,flag1=0,flag2=0;
- cin>>n;
- long long arr[2*n];
- for(int i=0;i<2*n;i++){
- cin>>arr[i];
- }
- if(n==1){
- if(arr[0]%2==0 && arr[1]%2==0){
- flag1=1;
- flag2=1;
- }
- }
- for(int i=0;i<n;i++){
- for(int j=i+1;j<n;j++){
- if((arr[i] + arr[j])%2==0){
- flag1=1;
- break;
- }
- }
- }
- for(int i=n;i<2*n;i++){
- for(int j=i+1;j<2*n;j++){
- if((arr[i]+arr[j])%2==0){
- flag2=1;
- break;
- }
- }
- }
- if(flag1==0 &&flag2==0){
- cout<<"Yes"<<endl;
- }else{
- cout<<"No"<<endl;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement