Given a set of numbers, check whether it can be partitioned into two subsets such that the sum of elements in both subsets is same or not.

**Input:**

The first line contains an integer '**T**' denoting the total number of test cases. Each test case constitutes of two lines. First line contains '**N**', representing the number of elements in the set and the second line contains the elements of the set.

**Output: **

Print **YES** if the given set can be partioned** **into two subsets such that the sum of elements in both subsets is equal, else print **NO**.

**Constraints: **

1 <= T <= 100

1 <= N <= 100

0 <= arr[i] <= 1000

**Example:
Input:**

2

4

1 5 11 5

3

1 3 5

**Output:**

YES

NO

**Explanation:
Testcase 1:** There exists two subsets such that {1, 5, 5} and {11}.

If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.

saiujwal13083 | 489 |

sudeep235poojary | 302 |

VithalNakod | 272 |

AshutoshPal1 | 254 |

go__karuna | 253 |

Soseph_Jtalin | 792 |

AshutoshPal1 | 722 |

architjindal__ | 648 |

go__karuna | 577 |

ArbazGrewal | 527 |

blackshadows | 5362 |

Ibrahim Nash | 5242 |

akhayrutdinov | 5111 |

mb1973 | 4931 |

Quandray | 4598 |

Login to report an issue on this page.