The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | May 2017 |
| Last Sign in: | 398 Weeks Ago, 5 Days Ago |
| Questions Answered: | 66690 |
| Tutorials Posted: | 66688 |
MCS,PHD
Argosy University/ Phoniex University/
Nov-2005 - Oct-2011
Professor
Phoniex University
Oct-2001 - Nov-2016
A Boy asks out a Girl for a date. The Girl told the Boy to get roses for her at that instant. She wants N different kinds of roses but only one of each type. Each rose have several layers of petals. The number of petals in each layer goes on decreasing from outside to inside. Now, the girl will count every petal of all the roses and if total petals of all the roses are odd then she will go with him otherwise she won’t. Help girl to make decision.
First line of input contains a number N total number of test cases.
First line of each test case will contain a number specifying types of roses T.
Each of the following T lines will contain two numbers. First number is difference D and second number is number of petals O in outermost layer.
YES if she goes on date and NO if she does not.
Â
Input: 2 2 1 9 3 8 4 2 4 3 9 1 9 2 7
Output:
NO YES
Â
Explaination
Two is the number of test cases.For First Input there are 2 Types of roses 1st Rose has 9 petals at outermost layer and 1 is the difference of petals from outer to inner side and second has 8 petals at outermost layer and 3 is the difference.For second Input there are 4 types of roses and the difference and number of petals of the outer most layer is given for each type of rose respectively.The sum for First 2type does not satisfy the condition of the girl hence output is NO,while the second does hence output is YES.
Hel-----------lo -----------Sir-----------/Ma-----------dam-----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------and----------- ac-----------qui-----------sit-----------ion----------- of----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n.P-----------lea-----------se -----------pin-----------g m-----------e o-----------n c-----------hat----------- I -----------am -----------onl-----------ine----------- or----------- in-----------box----------- me----------- a -----------mes-----------sag-----------e I----------- wi-----------ll