If the sofa is placed against the wall, it is not necessary for the square carpet tiles to cover the four corners of the sofa; it is enough that the two front corners remain on the carpet. For the room there are three possible ways to lay a rug. The first alternative is to lay a path at the foot of the bed. The path should be as long as (or longer than) the width of the bed. The second option is to put a path on each side of the bed.
And the third option is to stretch a square carpet tiles that is about the same size as the bed so that only the two front legs rest on the carpet. The idea is that two thirds of the carpet is under the bed, and the remaining third reboce to the feet.
Obviously it is unlikely that there is a carpet of the exact dimensions that the space needs, but surely there will be some whose dimensions are close and in case of doubt it is better to approach up and choose the largest carpet. Before buying, it is good to take the exact measurements of the chosen square carpet tiles and make an essay to confirm that it is large enough demarcating the space that would occupy the carpet with masking tape.