#include
#include
#include
#include<stdio.h>
#define PI 3.14159
using namespace std;
class Turns
{
int N;
int xa[50];
int ya[50];
public:
void input();
void calc();
};
void Turns::input()
{
cout<<“ENTER THE NUMBER OF MAPPING COORDINATES:”<<endl;
cin>>N;
do{
cout<<“ENTER AGAIN”<<endl;
cin>>N;
}while(N<3||N>50);
int x=-1;
int y=-1;
for(int i=0;i<N;i++){
cout<<"ENTER COORDINATE"<<endl;
cin>>x>>y;
while((x<0||x>50)&&(y<0||y>50))
{
cout<<"WRONG DATA! ENTER AGAIN!"<<endl;
cin>>x>>y;
}
xa[i]=x;
ya[i]=y;
}
}
void Turns::calc()
{
int c=0;
int a,b;
a=1;
b=3;
while(b<=N)
{
int t=(a+b)/2;
double s1=(ya[t-1]-ya[a-1])/(xa[t-1]-xa[a-1]);
double s2=(ya[b-1]-ya[t-1])/(xa[b-1]-xa[t-1]);
if((abs(atan(s1)-atan(s2))*180/PI)>45)
{
c=1;
break;
}
else
{
a++;
b++;
continue;
}
}
if(c==1)
cout<<"SHARP TURN!";
else
cout<<"NO!";
}
int main()
{
int T;
cout<<"ENTER THE NUMBER OF TEST CASES:"<<endl;
cin>>T;
Turns ob;
cin.ignore();
for(int i=1;i<=T;i++)
{
cout<<"TEST CASE :"<<i<<endl;
ob.input();
ob.calc();
}
return 0;
}