Rotate Page
Basic Accuracy: 19.74% Submissions: 410 Points: 1

You are given three points a, b, c on a page. Find if it’s possible to rotate the page around the point by an angle, such that the new position of ‘a’ is same as the old position of ‘b’, and the new position of ‘b’ is same as the old position of ‘c’. If such angle exists print “1”, else “0”.

Examples:
Input : a1 = 0, a2 = 1, b1 = 1, b2 =  1,
        c1 = 1, c2 = 0
Output : 1(means Yes)

Explanation : Rotate the page by 90 degree.
Input : a1 = 1, a2 = 1, b1 = 0, b2 = 0,
        c1 = 1000, c2 = 1000
Output : 0(means No)

 

Input : 
The first line of input contains an integer T denoting the Test cases. Then T test cases follow. 
Second line contains a1, a2, b1, b2, c1, c2.

Output : 
1 if it is possible to rotate the page; else 0

Constraints :
1 ≤ T ≤ 100
0 ≤ a1, a2, b1, b2, c1, c2 ≤ 100

Example:
Input : 
2
1 1 1 1 1 0
0 1 1 1 1 0

Output : 
0
1

to report an issue on this page.

Editorial

We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?

Yes

All Submissions

My Submissions:

Login to access your submissions.