forked from blank-27/Kodes
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1.cpp
More file actions
36 lines (28 loc) · 744 Bytes
/
1.cpp
File metadata and controls
36 lines (28 loc) · 744 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include <bits/stdc++.h>
#define ll long long int
#define sp(x,y) fixed<<setprecision(x)<<y
using namespace std;
int main() {
ll tt;
cin>>tt;
while(tt--)
{
int h,t;
int degree;
// cin>>h>>t>>degree;
scanf("%d %d %d",&h,&t,°ree);
double x = (degree*3.1415926535897932384626)/180;
double v2 = 20*h;
double v = sqrt(v2);
double s = (v*sin(x)*t) + (10*cos(x)*t*t)/2;
double T = (v*cos(x))/(10*sin(x));
int re = t / T;
double rem = t - T*re;
double ss = (v*cos(x)*rem) - (10*sin(x)*rem*rem)/2;
double c = s*s + ss*ss;
c = sqrt(c);
printf("%.12lf\n",c);
// cout<<sp(12,c)<<endl;
}
return 0;
}