#include <cstdio>
#include <cmath>

const long double EPS = 1e-3;

struct Point{
	long long x, y;
};

struct Line{
	Point a, b;
};

Point p[50000], g;
long long s[50000], sum[50000], ans, all, tri;
int n, q;

inline long long xmult(const Point & p1, const Point & p2, const Point & p0){
	return (p1.x - p0.x) * (p2.y - p0.y) - (p2.x - p0.x) * (p1.y - p0.y);
}

long long abs(long long t){
	if (t > 0) return t;
	return -t;
}

long long areaTriangle(const Point & p1, const Point & p2, const Point & p3){
	return abs(xmult(p1, p2, p3));
}

Point intersection(const Line & u, const Line & v){
	Point ret = u.a;
	long double t = ((u.a.x - v.a.x) * (v.a.y - v.b.y) - (u.a.y - v.a.y) * (v.a.x-v.b.x)) / ((u.a.x - u.b.x) * (v.a.y - v.b.y) - (u.a.y - u.b.y) * (v.a.x - v.b.x));
	ret.x += (u.b.x - u.a.x) * t;
	ret.y += (u.b.y - u.a.y) * t;
	return ret;
}

Point barycenter(const Point & a, const Point & b, const Point & c){
	Line u, v;
	u.a.x = (a.x + b.x) / 2;
	u.a.y = (a.y + b.y) / 2;
	u.b = c;
	v.a.x = (a.x + c.x) / 2;
	v.a.y = (a.y + c.y) / 2;
	v.b = b;
	return intersection(u, v);
}

Point barycenter(int n, const Point * p){
	Point ret, t;
	long double t1 = 0, t2;
	int i;
	ret.x = ret.y = 0;
	for (i = 1; i < n-1; i++){
		if (fabs(t2 = xmult(p[0], p[i], p[i+1])) > EPS){
			t = barycenter(p[0], p[i], p[i+1]);
			ret.x += t.x * t2;
			ret.y += t.y * t2;
			t1 += t2;
		}
	}
	if (fabs(t1) > EPS){
		ret.x /= t1;
		ret.y /= t1;
	}
	return ret;
}

bool sameSide(const Point & p1, const Point & p2, const Point & l1, const Point & l2){
	return xmult(l1, p1, l2) * xmult(l1, p2, l2) > 0;
}

int main(){
	int i, a, b;
	int cas = 0;
	while (scanf("%d%d", &n, &q) != EOF){
		if (n == 0 && q == 0) break;
		if (cas) puts("");
		++cas;

		for (i = 0; i < n; i++){
			scanf("%lld%lld", &p[i].x, &p[i].y);
		}
//		g = barycenter(n, p);
		g.x = g.y = 0;
		for (i = 0; i < n; i++){
			//s[i] = areaTriangle(p[i], p[(i + n -1) % n], g);
			s[i] = p[i].x*p[(i+n-1)%n].y - p[(i+n-1)%n].x*p[i].y;
			//printf("%lld ", s[i]);
		}
		sum[0] = s[0];
		for (i = 1; i < n; i++){
			sum[i] = sum[i-1] + s[i];
		}
		all = sum[n-1];
		for (i = 0; i < q; i++){
			scanf("%d%d", &a, &b);
			ans = sum[b] - sum[a];
			//printf("%.1lf\n", ans / 2.0);
			//tri = areaTriangle(p[a], p[b], g);
			tri = p[a].x*p[b].y - p[a].y*p[b].x;
			ans += tri;
			//printf("%.1lf\n", ans / 2.0);
			//if (sameSide(g, p[a + 1], p[a], p[b]))
			//	ans += tri;
			//else ans -= tri;
			if (all - ans < ans) ans = all - ans;
			printf("%.1lf\n", ans / 2.0);
		}
	}
	return 0;
}
