Happy Great BG-卡精度
Happy Great BG
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-卡精度的更多相关文章
- 51nod 1172 Partial Sums V2 卡精度的任意模数FFT
卡精度的任意模数fft模板题……这道题随便写个表就能看出规律来(或者说考虑一下实际意义),反正拿到这题之后,很快就会发现他是任意模数fft模板题.然后我就去网上抄了一下板子……我打的是最土的任意模数f ...
- 【TOJ 3005】Triangle(判断点是否在三角形内+卡精度)
描述 Given the coordinates of the vertices of a triangle,And a point. You just need to judge whether t ...
- 01背包+卡精度 Hdu 2955
<span style="color:#3333ff;">/* ---------------------------------------------------- ...
- UVA - 10200 Prime Time 关于 double类型 卡精度
题意: 给定一个区间,a到b, n在区间内,有一个计算素数的公式,n*n+n+41,将n带进去可以得出一个数字.但是这个公式可能不准确,求出这个公式在这个区间内的准确率. 直接模拟就好了,不过要 注意 ...
- CDOJ 1330 柱爷与远古法阵【高斯消元,卡精度】
柱爷与远古法阵 Time Limit: 125/125MS (Java/Others) Memory Limit: 240000/240000KB (Java/Others) Submit S ...
- Cable master---poj1064(二分|卡精度)
题目链接:http://poj.org/problem?id=1064 题意:有n条绳子,长度为Li,现在从这n条绳子中切割出K条相等的绳子,问切割出来的这k条绳子的最大长度为多少: 二分判断即可: ...
- hdu 1969 pie 卡精度的二分
Pie Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submiss ...
- 计算几何——圆卡精度cf1059D
double 在1e17以后就不能顾及小数,所以用一下加精度的技巧 sqrt(r*r-d*d)=sqrt(r+d)*sqrt(r-d) 遇到误差在几位以内的注意要修改二分的精度,用最大的数据去乘以精度 ...
- 计算几何-LA2218-HPI-第一次卡精度-vijos1087-铁人三项
This article is made by Jason-Cow.Welcome to reprint.But please post the writer's address. http://ww ...
- BZOJ 3675: [Apio2014]序列分割 动态规划 + 斜率优化 + 卡精度
Code: #include<bits/stdc++.h> #define N 100006 #define M 205 #define ll long long #define setI ...
随机推荐
- java中的双重锁定检查(Double Check Lock)
原文:http://www.infoq.com/cn/articles/double-checked-locking-with-delay-initialization#theCommentsSect ...
- 02 redis通用命令操作
set hi hello 设置值 get hi 获取值 keys * 查询出所有的key memcached 不能查询出所有的key keys *h 模糊查找key keys h[ie] 模糊查找 k ...
- Python学习总结之四 -- 这就是Python的字典
字典原来是这么回事儿 Python学习到现在,我们已经知道,如果想将值分组到结构中,并且通过编号对其进行引用,列表就可以派上用场.不过,今天,我们将学到一种通过名字引用值的数据结构,应该知道这种数据类 ...
- python opener代理
链接:http://www.jb51.net/article/46495.htm https://www.cnblogs.com/cunyusup/p/7341829.html
- 多通道(比方RGB三通道)卷积过程
今天一个同学问 卷积过程好像是对 一个通道的图像进行卷积, 比方10个卷积核,得到10个feature map, 那么输入图像为RGB三个通道呢,输出就为 30个feature map 吗, 答案肯定 ...
- python 基础 1.6 python 帮助信息及数据类型间相互转换
一. 帮助信息 # dir() 方法 查看函数的方法 # help() # type() 查看类型 name = raw_input('please input you name ...
- poj 2151Check the difficulty of problems<概率DP>
链接:http://poj.org/problem?id=2151 题意:一场比赛有 T 支队伍,共 M 道题, 给出每支队伍能解出各题的概率~ 求 :冠军至少做出 N 题且每队至少做出一题的概率~ ...
- php函数: set_include_path
<?php $p =get_include_path(); $p.=PATH_SEPARATOR.'./bp/'; $p.=PATH_SEPARATOR.'./CLI/'; $p.=PATH_S ...
- vsftp时间差8个小时的解决方法
$ vi /etc/vsftpd/vsftpd.conf use_localtime=YES ;
- spring-data-redis RedisTemplate操作
使用RedisTemplate来对对象.String等做缓存处理 首先定义一个对象并重写toString方法 public class UserInfo implements Serializable ...