Submission
Status:
P----P----
Score: 20
User: iwannasleep
Problemset: D.Think Sol!
Language: cpp
Time: 0.064 second
Submitted On: 2024-10-14 15:19:34
#include<bits/stdc++.h>
using namespace std;
int main()
{
long double h,m;
int n;
scanf(" %Lf %Lf",&h,&m);
long double hd=360/((h/2)*m),md=360/m;
scanf("%d",&n);
while(n--){
long double a,b;
scanf(" %Lf %Lf",&a,&b);
if(a>=h/2) a-=h/2;
a=a*m+b;
long double deg=((a*hd-b*md>0)?(a*hd-b*md):(-a*hd+b*md));
printf("%.2Lf\n",((deg>180)?360-deg:deg));
}
}