1512: Monster
Description
There was a boy called ZDD, and he loved a girl whose name is SZD. He loved her very much, and after answering the question, SZD became ZDD’s girlfriend. They fell in love with each other deeply. But the happy time wasn’t longer. One day SZD was caught by a big boss called TIANKENG. And ZDD decided to save his lover. On his way to TIANKENG’s castle, there was N monsters. And ZDD can kill the monster with a probability P. If ZDD killed one monster, he could get M keys. ZDD wanted to know what is the expectation of the number of keys he can get?
Input
The first line is an integer T, which indicates the number of test case.
For each test case, there are three integers N, P, M (1<=N<=10000, 0<=p<=100, 1<=M<=10000), which indicates the number of monsters, the probability of kill a monster, and the number of keys he can get.
Output
For each test case, you should print the answer in one line with two decimal places.
Sample Input
2
10 100 10
10 50 1
Sample Output
100.00
5.00
HINT
水体。
Code:
#include<stdio.h>
int main()
{
int T;
scanf("%d",&T);
while(T--)
{
int N,M;
double P;
scanf("%d %lf %d",&N,&P,&M);
printf("%.2lf\n",N*(P/100)*M);
}
return 0;
}