Submission

Status:
PPPPPPPPPP

Score: 100

User: iwannasleep

Problemset: D.Think Sol!

Language: cpp

Time: 0.059 second

Submitted On: 2024-10-14 15:20:17

#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("%Lf\n",((deg>180)?360-deg:deg));
	}
}