#include<bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define pb push_back
#define mp make_pair
#define rep(i,a,b) for(int i=a;i<b;i++)
#define fill(a, x) memset(a, x, sizeof(a))
#define all(x) (x).begin(), (x).end()
#define sz(x) (int)((x).size())
#define sva(v) sort(all(v))
#define rev(v) reverse(all(v))
#define svd(v) sva(v);rev(v) // reverses the sorted vector
#define endl '\n'
#define in_range(x, y, r , c) (x<r && y<c && x>=0 && y>=0)
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef vector<int> vi;
typedef pair<int,int> pi;
typedef vector<pi> vii;
long long MOD=1e9+7;
void solve(ll test){
double t,n,x1,y1,x2,y2,x3,y3,a,b,c,p,q,r,z;
cin>>t;
cin>>n;
rep(i,0,n){
cin>>x1>>y1>>x2>>y2>>x3>>y3;
a = (x1-x2)*(x1-x2)+(y1-y2)*(y1-y2);
a = sqrt(a);
b = (x2-x3)*(x2-x3) +(y2-y3)*(y2-y3);
b = sqrt(b);
c = (x3-x1)*(x3-x1) + (y3-y1)*(y3-y1);
c = sqrt(c);
string str;
if(a==b || b==c || a==c){
str="Isosceles ";
}
else str="Scalene ";
if(t==2){
p = (a*a + b*b - c*c)/(2*a*b);
p = acos(p);
p = (p*180)/M_PI;
q = (b*b + c*c - a*a)/(2*c*b);
q = acos(q);
q = (q*180)/M_PI;
r = (c*c + a*a - b*b)/(2*c*a);
r = acos(r);
r = (r*180)/M_PI;
z = max(p,q);
z = max(z,r);
if((int)z==90){
str+="right ";
}
else if((ll)p>90 || (ll)q>90 || (ll)r>90){
str+="obtuse ";
}
else str+="acute ";
}
str+="triangle";
cout<<str<<"\n";
}
}
int32_t main()
{
ios_base:: sync_with_stdio(0);//no uva
cin.tie(0);//no uva
// freopen("input.txt","r",stdin);
// freopen("output.txt","w",stdout);
ll t=1;
//cin>>t;
clock_t clk = clock();
rep(i,1,t+1) solve(i);
cerr << fixed << setprecision(6) << "Time: " << ((double)(clock() - clk)) / CLOCKS_PER_SEC << "\n";
return 0;
}
Why is this solution giving wrong answer for the input “-3 -1 -70 65 63 66”?