Submission
Status:
P----P----
Score: 20
User: amongus
Problemset: D.Think Sol!
Language: cpp
Time: 0.046 second
Submitted On: 2024-10-15 16:11:08
#include<bits/stdc++.h>
using namespace std;
int main(){
double h,m;
int q;
scanf("%lf %lf %d",&h,&m,&q);
h=h/2;
while(q--){
double x,y,ax,ay;
scanf("%lf %lf",&x,&y);
if(x>=h){
x=x-h;
}
ay=y/m*360;
ax=x/h*360+(y/m*(360/h));
double ans=abs(ax-ay);
ans=min(ans,360-ans);
printf("%.2lf\n",ans);
}
}