Happy Great BG

来源:互联网 发布:ubuntu共享文件夹路径 编辑:程序博客网 时间:2024/04/27 17:46

The summer training of ZJU ICPC in July is about to end. To celebrate this great and happy day, the coaches of ZJU ICPC TeamNavi and Fancy decided to BG everyone! Beside the two coaches, there areN participants. Those participants are divided into four groups to make problems for other groups.

After a brief discussion, they decided to go to Lou Wai Lou and have a great lunch. The cost for each person to have a meal inLou Wai Lou is W yuan. Though it is very expensive, there is a special discount thatLou Wai Lou provided: for every K persons, one of them can have a free meal.

Navi and Fancy will equally pay all the cost for this great BG. Please help them to calculate how much money they each need to pay. By the way, please take care that the minimum monetary unit of RMB is fen (0.01 yuan).

Input

There are multiple test cases (no more than 100).

For each test case, there is only one line which contains three numbers N (1 <= N <= 100), W (0 <=W <= 10000) and K (1 < = K <= 100).

Output

For each test case, output the money a coach need to pay, rounded into 0.01 yuan.

Sample Input

3 70 332 999 1

Sample Output

140.000.00
#include<stdio.h>int main(){    int n, k;    double w;    while (scanf("%d%lf%d", &n, &w, &k) == 3)    {        n += 2;        printf("%.2lf\n", w*(n - n / k) / 2 + 0.0049);//123.4444yuan也得付123.45yuan    }    return 0;}

 
0 0