Polycarpus like give present Paraskevi he buy chocolate bar shape segment rectangle the bar a1b1 segment large second a2b2 segment largePolycarpus want Paraskevi bar lunch break eat besides want polycarpuss mind Paraskevis beauty equally match bar number squaresTo bar number square Polycarpus eat little piece chocolate minute each minute follow break bar exactly half vertically horizontally eat exactly half bar chip exactly bar vertically horizontally eat exactly bar in case leave half bar second case leave third barBoth variant are not possible Polycarpus chip half for example bar 1623 Polycarpus chip half if bar 2018 Polycarpus chip half if bar 57 Polycarpus chip half thirdwhat minimum number minute Polycarpus need bar consist number square find require minimum number minute possible size bar process