Submission
Status:
PPPPPPPPPP
Score: 100
User: admin
Problemset: D.Think Sol!
Language: cpp
Time: 0.059 second
Submitted On: 2024-10-14 15:01:44
#include <stdio.h>
#include <math.h>
int H,M,T;
int main() {
scanf("%d%d%d",&H, &M, &T);
while (T--) {
int a,b;
scanf("%d%d", &a, &b);
double round = (double) H / 2;
if (a >= round) a-=round;
double mi = a*M + b;
double hh = (double) mi / (round*M);
double mm = (double) b / M;
hh *=360;
mm *=360;
// printf("%lf %lf\n", hh, mm);
double R = abs(hh - mm);
printf("%.12lf\n", R > 180 ? 360.0-R : R);
}
}