View Code of Problem 3807

#include<stdio.h>
int main()
{
    int tcase;
    scanf("%d",&tcase);
    while(tcase--){
        int t,m,a,b;
        double ans;
        scanf("%d%d",&t,&m);
        while(m--){
            scanf("%d%d",&a,&b);
            if(a==1){
                ans = b*(60-t)*1.0;
            }
            if(a==2){
                ans = 60.0*b*60/(60-t);
            }
            if(a==3){
               ans = b*3600*12*60.0/t;
            }
            printf("%.2lf\n",ans);
        }
    }
    return 0;
}

Double click to view unformatted code.


Back to problem 3807