Вот снова понадобилось. Теперь уже больше математичекое решение нужно.
FlatLand pianos are rectangles of various sizes. FlatLand building codes require all turns in corridors to be right angle turns and prohibit ``T'' intersections. You can assume that each portion of a corridor is long enough so that other corners or doors into rooms don't have any effect on getting around a turn. You can also assume that the piano is narrower than the width of any corridor. "
"Note that the piano actually has to turn in the corner, since it can only be pushed or pulled on one of its shorter sides (there are no square pianos). Your team's job is to write a program for a palmtop computer that will determine if a given piano will fit around a corner in a corridor. "
То есть имеем два коридора под прямым углом в виде буквы "Т" и пианино. Дана длинна пианино, ширина пианино, ширина первого коридора, ширина второго коридора. Как вычислить пролезет ли там пианино?