Submission
Status:
PPPPPPPPPP
Score: 100
User: kaopj
Problemset: D.Think Sol!
Language: cpp
Time: 0.050 second
Submitted On: 2024-10-14 20:38:07
/********************
* what the sigma *
********************/
#include <iostream>
#include <vector>
#include <iomanip>
#include <ios>
#include <map>
#include <queue>
#include <algorithm>
using namespace std;
#define lgm cin.tie(0)->sync_with_stdio(0);
#define be(x) x.begin(),x.end()
#define ve vector
#define ll long long
#define ull unsigned ll
#define f first
#define s second
#define pii pair<int, int>
#define tii tuple<int,int,int>
#define pll pair<ll,ll>
#define sz(x) (int)x.size()
#define pb push_back
const int mod = 1e9+7,maxn=1000005;
int h,m;
void test() {
int a,b;
cin >>a >> b;
a=a%h;
double deg=360./h*a-(360./m-360./h/m)*b;
while (deg >= 360) deg-=360;
while (deg < 0) deg+=360;
printf("%.12lf\n",min(deg,abs(360.0-deg)));
}
signed main() {
lgm;
cin >> h >> m;
h/=2;
int t;
cin >> t;
while (t--) test();
}