Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.*;
- import java.util.*;
- public class A {
- public static void main(String[] args) throws NumberFormatException, IOException {
- Scanner sc = new Scanner(System.in);
- //Scanner sc = new Scanner(new File("A.in"));
- int ncase = sc.nextInt();
- for (int cs = 1; cs <= ncase; cs++) {
- long x1 = sc.nextLong(), y1 = sc.nextLong(), z1 = sc.nextLong();
- long x2 = sc.nextLong(), y2 = sc.nextLong(), z2 = sc.nextLong();
- long x3 = sc.nextLong(), y3 = sc.nextLong(), z3 = sc.nextLong();
- long dx12 = x1 - x2, dy12 = y1 - y2, dz12 = z1 - z2;
- long dx23 = x2 - x3, dy23 = y2 - y3, dz23 = z2 - z3;
- long dx31 = x3 - x1, dy31 = y3 - y1, dz31 = z3 - z1;
- long l12 = dx12*dx12 + dy12*dy12 + dz12*dz12;
- long l23 = dx23*dx23 + dy23*dy23 + dz23*dz23;
- long l31 = dx31*dx31 + dy31*dy31 + dz31*dz31;
- if (l12 + l23 == l31 || l23 + l31 == l12 || l31 + l12 == l23) {
- System.out.println("right-angled");
- } else if (l12 == l23 && l23 == l31) {
- System.out.println("equilateral");
- } else {
- System.out.println("neither");
- }
- }
- sc.close();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement