Submission

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

Score: 20

User: amongus

Problemset: D.Think Sol!

Language: cpp

Time: 0.060 second

Submitted On: 2024-10-15 14:27:15

#include<stdio.h>
#include<math.h>
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);
        if(ans>=180){
            ans=360-ans;
        }
        printf("%.2lf\n",ans,ax,ay);
    }


}