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 3
32 999 1

Sample Output

140.00
0.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+=;
ss=w*(n-(int)(n/k))/+0.009;
x=ss*;
ss=(double)x/;
printf("%.2lf\n",ss);
}
return ;
}

Happy Great BG-卡精度的更多相关文章

  1. 51nod 1172 Partial Sums V2 卡精度的任意模数FFT

    卡精度的任意模数fft模板题……这道题随便写个表就能看出规律来(或者说考虑一下实际意义),反正拿到这题之后,很快就会发现他是任意模数fft模板题.然后我就去网上抄了一下板子……我打的是最土的任意模数f ...

  2. 【TOJ 3005】Triangle(判断点是否在三角形内+卡精度)

    描述 Given the coordinates of the vertices of a triangle,And a point. You just need to judge whether t ...

  3. 01背包+卡精度 Hdu 2955

    <span style="color:#3333ff;">/* ---------------------------------------------------- ...

  4. UVA - 10200 Prime Time 关于 double类型 卡精度

    题意: 给定一个区间,a到b, n在区间内,有一个计算素数的公式,n*n+n+41,将n带进去可以得出一个数字.但是这个公式可能不准确,求出这个公式在这个区间内的准确率. 直接模拟就好了,不过要 注意 ...

  5. CDOJ 1330 柱爷与远古法阵【高斯消元,卡精度】

    柱爷与远古法阵 Time Limit: 125/125MS (Java/Others)     Memory Limit: 240000/240000KB (Java/Others) Submit S ...

  6. Cable master---poj1064(二分|卡精度)

    题目链接:http://poj.org/problem?id=1064 题意:有n条绳子,长度为Li,现在从这n条绳子中切割出K条相等的绳子,问切割出来的这k条绳子的最大长度为多少: 二分判断即可: ...

  7. hdu 1969 pie 卡精度的二分

    Pie Time Limit: 5000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submiss ...

  8. 计算几何——圆卡精度cf1059D

    double 在1e17以后就不能顾及小数,所以用一下加精度的技巧 sqrt(r*r-d*d)=sqrt(r+d)*sqrt(r-d) 遇到误差在几位以内的注意要修改二分的精度,用最大的数据去乘以精度 ...

  9. 计算几何-LA2218-HPI-第一次卡精度-vijos1087-铁人三项

    This article is made by Jason-Cow.Welcome to reprint.But please post the writer's address. http://ww ...

  10. BZOJ 3675: [Apio2014]序列分割 动态规划 + 斜率优化 + 卡精度

    Code: #include<bits/stdc++.h> #define N 100006 #define M 205 #define ll long long #define setI ...

随机推荐

  1. GIT客户端的使用【原创】

    这次分享的方式,采用的是视频的形式,视频是本人录制. 在做项目使用SVN的时候经常有各种错误出现,所以萌发使用git的想法.在学习git的过程中发现一个神器就是分支,虽然在SVN里也有分支,但由于机制 ...

  2. FTPHelper类

    using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.N ...

  3. ASP.NET动态网站制作(13)-- JQ(5)

    前言:jq的最后一节课,主要讲解应用, 内容: 1.会飞的li: HTML代码: <!DOCTYPE html> <html xmlns="http://www.w3.or ...

  4. python 基础 3.1 打开文件 a a+ r+ w+ 详解

      一.python 访问文件   1.在python中要访问文件,首先要打开文件,也就是open ---open   r:  只读   w:  只写 ,文件已存在则清空,不存在则创建   a:追加 ...

  5. EasyPlayerPro Windows播放器本地快照抓拍截图功能实现方法

    背景描述 作为一个播放器,截图功能必不可少; 下面主要记录一下截图功能的实现: 实现流程 将解码后的帧进行格式转换(目标格式为RGB24); 采用独立的线程进行截图处理; 截图可保存为BMP或JPG两 ...

  6. Centos7重新安装yum

    Centos7重新安装yum rpm -qa|grep yum 然后用下面的命令删除出现的xxx包: rpm -e --nodeps xxx 下载 python-urlgrabber-3.10-8.e ...

  7. 微信小程序 原生代码 转wepy 字符串处理

    import globimport os cwd = os.getcwd()sep = os.septarget = cwd + sep + 'pages' + sep + '*' + sep + ' ...

  8. Paxos is Simple

    [角色]0-MainProposer提案生成者1-提案发送者(MainProposer+OtherProposer)2-提案接收者(Acceptor)[动作]0-MainProposer----> ...

  9. imagecopyresampled()改变图片大小后质量要比imagecopyresized()高。

    php程序中改变图片大小的函数大多数人都想到用imagecopyresized(),不过经过测试比较发现,使用imagecopyresampled()改变的图片质量更高. 下面我们来看看两者的比较结果 ...

  10. SAP流水号

    [转]编号范围对象维护 Tcode: SNRO OYSM   1.Number Range的通用Tcode:SNRO   2.Number Range的通用读取函数:NUMBER_GET_NEXT 3 ...