|
|||
The Lazy LumberjacksOnce upon a time in a far, far away forest, there was a team of lazy lumberjacks. Since they were too lazy to cut trees, they were always figuring out ways to sneak out of work. Their foreman, on the other side, was always trying to put them all to work. After a lot of discussions, the foreman and the lumberjacks came to an agreement: they will work, but only if the area of the forest assigned to each one was a triangle. If it was any other shape, they will be free not to work that week. The idea was to give each lumberjack three numbers representing the lengths of each of the triangles' sides. If the numbers were correct and form a triangle, the lumberjacks had to work, else they were free to leave and not work. Since our lumberjacks are as cunning as they are lazy, they convince the foreman to let them determine the surface and the site in the forest where they will work. As a result, the lumberjacks keep passing the foreman sets of numbers that could not form the sides of a triangle. After a while, the foreman began to suspect and decided to write a program that validates the input of each lumberjack. Now, when the lumberjacks decide to pass wrong numbers, they get a fine of $1000.00 (more than a day's salary).
Your job is to write the program that the foreman has to use to determine if the
numbers (all integers) passed by the lumberjacks can be the sides of a triangle.
If they can, you have to print “ Input SpecificationThe input consists of a data set describing the numbers that each lumberjack has passed to the foreman for the day. The data is formatted as follows: The first line is an integer N (2 ≤ N ≤ 20). Then follows N lines, each one containing three integers separated by a space. All integers are between -109 and 109. Output Specification
For each line in the input, you have to find if the integers can represent the sides
of a triangle. If they can, you have to print “ Sample Input
Output for Sample Input
|
|||
University of Debrecen; Faculty of Informatics; v. 09/30/2024 |