DescriptionGivenasetofsticksofvariouslengths,isitpossibletojointhemend-to-endtoformasquare?InputThefirstlineofinputcontainsN,thenumberoftestcases.Eachtestcasebeginswithaninteger4<=M<=20,thenumberofsticks.Mintegersfollow;eachgivesthelengthofastick-anintegerbetween1and10,000.OutputForeachcase,outputalinecontaining"yes"ifisispossibletoformasquare;otherwiseoutput"no".SampleInput[cray...
近期评论