Basically, the problem is finding the tree height based on the distance to the tree and angle from view to the tree (in other words, the tricky maker made it so that your angle + 90 was what resulted; they gave you 90-180 value, I don't know why, just a variation probably)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
#include <iostream>
#include <math.h>
#define PI 3.14159265
usingnamespace std;
int main(){
int a;
cin>>a;
int d;
float b;
int h;
for (int i=0;i<a;i++){
cin>>d;
cin>>b;
//Default is radian mode
int c= ((b-90)*PI)/180;
h=d* tan(c);
cout<<round(h)<<" ";
}
}