Problem: Example

Input

100 1 0
50 100


Output

14.57738

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;

#define rep(i, n) for(int i = 0; i < (n); i++)
#define repp(i, l, r) for(int i = (l); i < (r); i++)
#define per(i, n) for(int i = ((n)-1); i >= 0; i--)
#define perr(i, l, r) for(int i = ((r)-1); i >= (l); i--)
#define all(x) (x).begin(),(x).end()
#define MOD 1000000007
#define IINF 1000000000
#define LINF 1000000000000000000
#define SP <<" "<<
#define CYES cout<<"Yes"<<endl
#define CNO cout<<"No"<<endl
#define CFS cin.tie(0);ios::sync_with_stdio(false)

typedef long long LL;
typedef long double LD;

int main(){
  double d;
  int n,b;
  cin >> d >> n >> b;
  vector<double> p(n),h(n);
  rep(i,n) cin >> p[i] >> h[i];
  double ans=IINF;
  repp(t,1,b+2){
    double l = d/t;
    double m = 0;
    rep(i,n){
      double pos=p[i]-floor(p[i]/l)*l;
      double hh=pos*(l-pos);
      m = max(m,h[i]/hh);
    }
    double vx2 = min(l/2,1.0/2/m);
    ans=min(ans,vx2+l*l/4/vx2);
  }
  cout << fixed << setprecision(10) << sqrt(ans) << endl;
  return 0;
}