Carpet merchant Alibaba has a rectangular carpet of unknown dimensions. Unfortunately, his measuring tape is broken, and he has no other measuring tools. However, he discovered that when the carpet is laid flat in either of his two shops, each corner of the carpet exactly meets different walls of the shop. He knows that the length and width of the carpet are both integers in feet. The two shops have one side of the same length (unknown), and the other side is 38 feet and 50 feet respectively. Determine the dimensions of the carpet. (1 foot = 0.3048 meters)