Captain Flint crew head savage shore Byteland month drink rum tell story in moment uncle Bogdan remember nephew Denis Today tell story Denis helped come interesting problem ask crew solve itIn beginning uncle Bogdan write board positive integer x consist n digit after wipe x write integer k instead concatenation binary representation digit x consist lead zero for example let x 729 k 111101001 7 111 2 10 9 1001after time uncle Bogdan understand do not know k ask Denis help Denis decide wipe n digits k name new number ras result Denis propose find integer x length n r number maximum possible if multiple valid x deni interested minimum oneall crew member include captain Flint easily solve task all cabin boy Kostya drunk think straight but younote task compare integer x k number despite representation write 729 1999 111 1000