Problem: Example

Input

100 1 0
50 100


Output

14.57738

Solution (in CPP):

Solution:
/*
Author:
Prob:
Link:
Tag:
Comp:
*/

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

#define ll long long
#define ull unsigned long long
#define ii pair<int,int>
#define iii pair<ii, int>
#define dd pair<double, double>

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define ep emplace_back
#define sz(a) (int) a.size()
#define cl(a) a.clear()

#define vi vector<int>
#define vii vector<ii>

#define FOR(x,a,b) for (int x=a;x<=b;x++)
#define FOD(x,a,b) for (int x=a;x>=b;x--)
#define REP(x,a,b) for (int x=a;x<b;x++)
#define RED(x,a,b) for (int x=a;x>b;x--)

const int MAX = 1e5 + 10;
const int MAXN = 1e4 + 10;
const int MOD = 1e9 + 7;
const int inf = 1e9;
const double pi = acos(-1.0);
const double eps = 1e-9;

inline int cmp(double x){
	if (fabs(x) <= eps) return 0;
	if (x > 0) return 1;
	return -1;
}

int main(){
	// freopen("test.in", "rt", stdin);
	ios::sync_with_stdio(false);

	dd a[20];
	int n, m;
	double d, l, Vy, x, y;
	int flag = 0;

	cin >> d >> n >> m;
	REP(i,0,n)
		cin >> a[i].fi >> a[i].se;
	double res = 1LL << 32LL;
	FOR(i,0,m){
		l = d/(i+1);
		Vy = 0;
		flag = 0;
		REP(j,0,n){
			x = a[j].fi;
			y = a[j].se;
			while (cmp(x-l) >= 0) x -= l;
			if (!cmp(x)){
				flag = 1;
				break;
			}
			double V1 = l*sqrt(y/(2*x*(l-x)));
			if (cmp(V1-Vy) >= 0) Vy = V1;
		}
		if (flag) continue;
		double Vx = l/2.0/Vy;
		double s;
		if (cmp(Vx - Vy) >= 0) Vx = Vy = sqrt(l/2.0);
		s = sqrt(Vx * Vx + Vy * Vy);
		if (cmp(res - s) >= 0) res = s;
	}
	cout << fixed << setprecision(7) << res << endl;

	return 0;
}