fork download
  1. #include <iostream>
  2. #include <math.h>
  3. using namespace std;
  4. int main() {
  5. double n, x, y;
  6. cin >> n >> x >> y;
  7. double r = (n * y) / (x + y);
  8. if ((n - r) * y < (r + 1) * x)
  9. r = (n - r) * y;
  10. else
  11. r = (r + 1) * x;
  12. cout << int(ceil(r));
  13. return 0;
  14. }
Success #stdin #stdout 0s 4416KB
stdin
200000000 6 1





stdout
171428572