The One Where It All Began solution codechef
In a New York City coffee house called Central Perk, we’re introduced to six friends: chef Monica Geller, data controller Chandler Bing who lives across the hall from Monica, Chandler’s roommate/actor Joey Tribbiani, Monica’s brother Ross Geller, new ageist Phoebe Buffay, and “born to be a wife” Rachel Green.
Chef wants to dividecookies between the six friends such that:
- Each friend gets at least one cookie.
- No two friends get the same number of cookies.
Find if it is possible for Chef to do so.
Input Format The One Where It All Began solution codechef
- First line will contain , number of testcases. Then the testcases follow.
- Each testcase contains of a single line of input, one integers .
The One Where It All Began solution codechef Output Format
For each test case print “YES” if Chef can divide the cookies according to the given rules, else print “NO”.
You may print each character of each string in uppercase or lowercase (for example, the strings “yEs”, “yes”, “Yes” and “YES” will all be treated as identical).
Sample Input 1
3 42 5 909
Sample Output 1 The One Where It All Began solution codechef
YES NO YES
Test case 1: One possible way of distribution would be.
Test case 2: It is impossible to dividecookies among six friends according to given rules.