assume this is the left side. Then the three corners of the triangle must be touching the three other sides of the square, for otherwise we could make the triangle bigger. Then we can slide the triangle to the left until it touches this left side with one of the corners that touches either the top or bottom side as well