The
topic describes small Yu 3 years old, likes playing the ball very much, seems to like playing the basketball ^_^ in the future. She recently found that when the ball fell from her hand, she jumped back to half of the original height each time she landed, fall again, each time the ball hit several times when the ball, the number of n times when the father on the side of the shouting stop, asked little yoga now the ball in the end how many distance, small yoga pretending to meditate, dad asked the next small ball can jump how high ah, little yoga shook his head, How can I know if my father is God? At this time you are on the side of the advice to small yoga to write a program calculation, so the task to you. Assuming the initial height of the ball is H, calculate the distance of the ball after the nth landing, and how high the bounce can be after landing.
input Data has multiple groups, the first behavior Data group T, the following T behavior T-group data, each row has two numbers h and N, separated by a space.
output of the first n rebound when the ball passes the distance and the final height of the ball, retain 2 digits after the decimal point.
Sample Input
2
1
100.0 2
Sample output
100.00 50.00
200.00 25.00
#include <stdio.h>
void Main ()
{
int a,i;
Double s,t,m,n;
scanf ("%d", &a);
while (a--)
{
s=0;
scanf ("%lf%lf", &m,&n);
T=m;
for (i=1;i<=n;i++)
{
s=s+m*2;
M=M/2;
}
S=s-t;
printf ("%.2lf%.2lf\n", s,m);
}
}