LittleXhasndistinctintegers:p1, p2, ..., pn.HewantstodivideallofthemintotwosetsAandB.Thefollowingtwoconditionsmustbesatisfied:IfnumberxbelongstosetA,thennumbera - xmustalsobelongtosetA.IfnumberxbelongstosetB,thennumberb - xmustalsobelongtosetB.HelpLittleXdividethenumbersintotwosetsordeterminethatit'simpossible.InputThefirstlinecontainsthreespace-separatedintegersn, a, b(1...
Peterhadacubewithnon-zerolengthofaside.Heputthecubeintothree-dimensionalspaceinsuchawaythatitsverticeslayatintegerpoints(itispossiblethatthecube'ssidesarenotparalleltothecoordinateaxes).Thenhetookapieceofpaperandwrotedowneightlines,eachcontainingthreeintegers—coordinatesofcube'svertex(asinglelinecontainscoordinatesofasinglevertex,eachvertexiswrittenexactlyonce),putthepaperonthetableandleft.Wh...
近期评论