I was solving the problem HAMSTER1 using C. After reading the comments,(and actually getting WA
) i shifted from float to double for the problem. But to my dismay, the code has started playing with me..
. The code is:
#include<math.h>
#include<stdio.h>
int main() {
double th,r,h,k1,k2;
int n,v;
scanf("%d",&n);
while(n--){
scanf("%d%f%f",&v,&k1,&k2);
//code
printf("%.3f\n",th);
}
return 0;
}
It's output for sample prob is:
3
10 10 0
0.785 10.000 2.500 -26843545600.000
10 0 10
0.785 10.000 2.500 -26843545600.000
10 10 10
0.785 10.000 2.500 -26843545600.000

Can someone help me defeat my C compiler..!? 