Submission

Status:
P----P----

Score: 20

User: amongus

Problemset: D.Think Sol!

Language: cpp

Time: 0.278 second

Submitted On: 2024-10-15 16:20:18

#include<bits/stdc++.h>
using namespace std;
int main(){
    double h,m;
    int q;
    cin>>h>>m>>q;
    ///scanf("%lf %lf %d",&h,&m,&q);
    h=h/2;
    while(q--){
        double x,y,ax,ay;
        cin>>x>>y;
        ///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);
        cout << fixed << setprecision(2) << ans<<"\n";
    }


}