divide the piece of cloth, 40cm, in two parts so that the longest 1cm exceed twice the shortest piece. As measure the two parts

x + 2x + 1 = 40

3x = 39

x = 13

If I understand your problem correctly, the shortest piece is 13 centimeters long.