## GUPTA MECHANICAL

IN THIS WEBSITE I CAN TELL ALL ABOUT TECH. TIPS AND TRICKS APP REVIEWS AND UNBOXINGS ALSO TECH. NEWS .............

## [Solution] Group Assignment CodeChef Solution

Chef is hosting a party at his house and $N$ people are invited to it. Everyone has arrived and they are eager to make a group and chit-chat.

The ${i}^{th}$ person prefers to be in a group of exactly ${P}_{i}$ people (including himself). A person who is not in a group of preferred size gets upset. Find whether Chef would be able to assign every person to a group such that everyone remains happy.

### Input Format

• The first line of input will contain a single integer $T$, denoting the number of test cases.
Solution Click Below:-  👉
👇👇👇👇👇

• Each test case consists of multiple lines of input.
• The first line of each test case contains an integer $N$ — the number of people at the party.
• The next line contains the array $P$ — where ${P}_{i}$ denotes the preferred group size
Group Assignment CodeChef Solution

•  for ${i}^{th}$ person.

### Output Format

For each test case, output YES, if Chef can assign every person to a group such that everyone remains happy. Otherwise output NO.

Counting Words CodeChef Solution

MATH1 Enrolment CodeChef Solution

Group Assignment CodeChef Solution

Army Training CodeChef Solution

Sort the String CodeChef Solution

Prime Xor CodeChef Solution

Vowel Anxiety CodeChef Solution

Array sorting CodeChef Solution

The output is case-insensitive, meaning that outputs such as yESYeSYES and yes mean the same.

### Constraints

• $1\le T\le 1000$
• $2\le N\le {10}^{5}$
• $2\le {P}_{i}\le N$
• Sum of $N$ over all test cases does not exceed