# zoj 3693 Happy Great BG

Posted by 111qqz on Thursday, February 18, 2016

## TOC

http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3693

``````/* ***********************************************
Author :111qqz
Created Time :2016年02月18日 星期四 15时16分59秒
File Name :code/zoj/3693.cpp
************************************************ */

#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <string>
#include <cmath>
#include <cstdlib>
#include <ctime>
#define fst first
#define sec second
#define lson l,m,rt<<1
#define rson m+1,r,rt<<1|1
#define ms(a,x) memset(a,x,sizeof(a))
typedef long long LL;
#define pi pair < int ,int >
#define MP make_pair

using namespace std;
const double eps = 1E-8;
const int dx4[4]={1,0,0,-1};
const int dy4[4]={0,-1,1,0};
const int inf = 0x3f3f3f3f;
int n,k;
double ans,w;
int dblcmp(double d)
{
return d<-eps?-1:d>eps;
}
int main()
{
#ifndef  ONLINE_JUDGE
freopen("code/in.txt","r",stdin);
#endif

while (~scanf("%d %lf %d",&n,&w,&k))  //认真读题
{
if (dblcmp(w)==0)
{
puts("0.00");
continue;
}
n = n + 2;
n = n-n/k;
ans = n*w;
ans = ans * 50;
printf("%.2f\n",int(ans+0.5)*1.0/100);
}

#ifndef ONLINE_JUDGE
fclose(stdin);
#endif
return 0;
}
``````

「真诚赞赏，手留余香」