博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Happy Great BG-卡精度
阅读量:5150 次
发布时间:2019-06-13

本文共 1767 字,大约阅读时间需要 5 分钟。

Happy Great BG

Time Limit: 2000ms
Case Time Limit: 2000ms
Memory Limit: 65536KB
 
64-bit integer IO format: 
%lld      Java class name: 
Main

The summer training of ZJU ICPC in July is about to end. To celebrate this great and happy day, the coaches of ZJU ICPC Team Navi and Fancy decided to BG everyone! Beside the two coaches, there are N 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 in Lou Wai Lou is W yuan. Though it is very expensive, there is a special discount that Lou 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"iostream"#include"algorithm"#include"cstring"#include"queue"#include"cmath"#include"cstdio"#include"cstdlib"using namespace std;#define sr(x) scanf("%d",&x)#define sc(x) printf("%d",x)#define hh printf("\n")int main(){    double n,w,k,ss;    int x;    while(scanf("%lf%lf%lf",&n,&w,&k)!=EOF)    {        n+=2;        ss=w*(n-(int)(n/k))/2+0.009;        x=ss*100;        ss=(double)x/100;        printf("%.2lf\n",ss);    }    return 0;}

 

转载于:https://www.cnblogs.com/lveternal/p/3420249.html

你可能感兴趣的文章
TestDriven.NET 怎么设置快捷键keyboard shortcut(转)
查看>>
Jquery取得iframe中元素的几种方法Javascript Jquery获取Iframe的元素、内容或者ID,反之也行!...
查看>>
JavaServlet的文件上传和下载
查看>>
29. Populating Next Right Pointers in Each Node && Populating Next Right Pointers in Each Node II
查看>>
Linux与网络
查看>>
WOJ 1619
查看>>
软件构造的八个多维视图
查看>>
python学习一使用dict和set
查看>>
任务调度框架Quartz原理简介
查看>>
乌龟爬行问题
查看>>
vb6.0 快捷键
查看>>
201671010127 2016-2017-12 初学图形用户界面
查看>>
POJ-1061 青蛙的约会
查看>>
ZOJ-2836 Number Puzzle
查看>>
poj3463 Sightseeing(读题很重要)
查看>>
hdu6181 How Many Paths Are There(次短路条数[模板])
查看>>
python学习日记(常用模块)
查看>>
正则表达式和样式匹配
查看>>
8_分析一下JVM
查看>>
进程PCB
查看>>