#include using namespace std; using ll=long long; using pii=pair; #define all(a) a.begin(),a.end() #define pb push_back #define sz(a) ((int)a.size()) const int N=305,mod=998244353; int add(int x, int y){x+=y; if(x>=mod) x-=mod; return x;} int sub(int x, int y){x-=y; if(x<0) x+=mod; return x;} int mul(int x, int y){return ((ll)x)*y%mod;} int Pow(int x, ll y=mod-2){int res=1; for(; y; x=mul(x,x),y>>=1) if(y&1) res=mul(res,x); return res;} const double eps = 1e-8, pi = acos(-1); int sign(double x) {return abs(x) <= eps ? 0 : (x > 0 ? 1 : -1);} struct Pt{ ll x,y; constexpr Pt(ll _x=0, ll _y=0):x(_x),y(_y){} Pt operator + (Pt o) {return Pt(x + o.x, y + o.y);} Pt operator - (Pt o) {return Pt(x - o.x, y - o.y);} Pt operator * (ll k) {return Pt(x * k, y * k);} Pt operator / (ll k) {return Pt (x / k, y / k);} ll operator * (Pt o) {return x * o.x + y * o.y;} ll operator ^ (Pt o) {return x * o.y - y * o.x;} }; struct Line { Pt a, b; }; int ori(Pt o, Pt a, Pt b) {return sign((o - a) ^ (o - b));} bool btw(Pt a, Pt b, Pt c) { // c on segment ab? return ori(a, b, c) == 0 && sign((c - a) * (c - b)) <= 0; } bool SegsInter(Line a, Line b) { if (btw(a.a, a.b, b.a)) return 1; if (btw(a.a, a.b, b.b)) return 1; if (btw(b.a, b.b, a.a)) return 1; if (btw(b.a, b.b, a.b)) return 1; if (ori(a.a, a.b, b.a) * ori(a.a, a.b, b.b) == -1 && ori(b.a, b.b, a.a) * ori(b.a, b.b, a.b) == -1) return 1; return 0; } int n,m; double dis[N][N]; Line a[N]; bool good(Line l, int x, int y){ for(int i=0; i> n >> m; for(int i=0; i> a[i].a.x >> a[i].a.y >> a[i].b.x >> a[i].b.y; for(int i=0; i> a1 >> b1 >> a2 >> b2; a1--,b1--,a2--,b2--; cout << dis[a1*2+b1][a2*2+b2] << "\n"; } }