#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int a;
  long long int b;
  long long int c;
  double d;
  double e;
  double f;
  double g = 0;
  long long int h;
  cin >> a;
  cin >> b;
  cin >> c;
  if (a % b == 0) {
    cout << c << endl;
  } else {
    d = (((a / b) + 1) * b - a) * (1 / (2 * c * double(1.0)));
    e = a * (1 / (c * double(1.0)));
    f = d + e;
    h = (1 / f);
    if ((1 - (f * h)) <= e) {
      g = g + (1 - (f * h)) * c;
    } else {
      g = g + a;
      g = g + (1 - (f * h) - e) * 2 * c;
    }
    cout << setprecision(15) << (g + h * ((a / b) + 1) * b) << endl;
  }
  return 0;
}
