HDU4530+模拟

 1 /*

 2 

 3 */

 4 #include<stdio.h>

 5 #include<string.h>

 6 #include<stdlib.h>

 7 #include<algorithm>

 8 #include<iostream>

 9 #include<queue>

10 #include<stack>

11 #include<math.h>

12 #include<map>

13 using namespace std;

14 const int maxn = 1005;

15 int main(){

16     int ca,T;

17     T = 1;

18     scanf("%d",&ca);

19     while( ca-- ){

20         int x;

21         scanf("%d",&x);

22         int q;

23         scanf("%d",&q);

24         while( q-- ){

25             int f,t;

26             scanf("%d%d",&f,&t);

27             if( f==1 ){

28                 printf("%.2lf\n",1.0*t*(60-x));

29             }

30             else if( f==2 ){

31                 printf("%.2lf\n",1.0*t*3600/(1.0*(60-x)));

32             }

33             else{

34                 printf("%.2lf\n",1.0*12*3600*60*t/(1.0*x));

35             }

36         }

37     }

38     return 0;

39 }

40                 

41                 

42                 

43                 

44             
View Code

纯公式

你可能感兴趣的:(HDU)