/* -*- coding: utf-8 -*- * * 926.cc: No.926 休日の平均 - yukicoder */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; /* constant */ const int MAX_B = 1000; /* typedef */ /* global variables */ int hs[MAX_B * 2 + 1]; /* subroutines */ /* main */ int main() { int a, b, c; scanf("%d%d%d", &a, &b, &c); for (int i = 0; i < b * 2; i++) hs[i + 1] = hs[i] + ((i % b < c) ? 1 : 0); int d = a % b; int sum = 0; for (int i = 0; i < b; i++) sum += hs[i + d] - hs[i]; printf("%.8lf\n", (double)sum / b + a / b * c); return 0; }