大笨钟

来源:互联网 发布:数据结构必背算法 编辑:程序博客网 时间:2024/05/20 16:41
#include<stdio.h>#include<stdlib.h>int T,x,q,t,k,kind;int main(){scanf("%d",&T);while(T--){    scanf("%d%d",&x,&q);    double res;    while(q--){    scanf("%d%d",&kind,&k);    if(kind==1){res=k*(60-x)*1.0;    printf("%.2f\n",res);}else if(kind==2){res=(60*k)*1.0*60/(60-x);    printf("%.2f\n",res);}else if(kind==3){    res=720*3600*1.0/x*1.0;    printf("%.2f\n",res*k);}}}//system("pause");    return 0;}