Social Icons

twitterfacebookgoogle pluslinkedinrss feedemail

Monday, August 27, 2012

BUBTPC 2nd Problem I - Boring Math Assignment


Boring Math Assignment

Problem Description:
Like all the other students in the class Rakib hates math assignment. Today his math teacher taught him about “Triangle”. A Triangle is a geometrical shape with three corners and three sides or edges which are line segments. After the class his teacher gave him some homework, where in every task he was given three line segments and he needed to answer whether these lines could form a triangle shape or not. Rakib didn’t want to do this assignment by himself; As you are a good computer programmer, he requests you to write a program that will output the answer “Yes”, if these line segments can form a triangle or “No” if these line segments cannot form a triangle for each of his tasks.

Input:
First line of the input is an integer number T (1<=T<=100) represents the number of tasks assigned to Rakib. For every task you need to take three lines as input. Every line is represented by its two end points (x1 y1) and (x2,y2). All the co-ordinates are integer and within -106 to 106.

Output:
For every task you need to output the result in a separate line. See sample input/output for more details.

Sample Input/output:
Sample input
Sample output
1
0 0 0 1
0 0 1 0
0 1 1 0
Yes



Explanation of sample case:
In the sample case there is only one task for Rakib. (0,0) (0,1) is the first line segment , (0,0) (1,0) is the second line segment and (0,1) (1,0) is the third line segment. Output for the sample input is “Yes” because the given line segments can form triangle.

Problem setter: Abu Obaida Opu, CSE
Bangladesh University of Business and Technology (BUBT)

No comments:

Post a Comment

 

Sample text

Sample Text