#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<cmath>
#include<map>
#include<iomanip>
#include<queue>
#include<stack>
#include<time.h>
#define rep(i,n)for(int i=0;i<n;i++)
#define int long long
#define ggr getchar();getchar();return 0;
#define prique priority_queue
#define mod 1000000007
#define inf 1e15
#define key 1e9
using namespace std;
typedef pair<int, int>P;
void yes() { cout << "Yay!" << endl; }
void no() { cout << ":(" << endl; }
int gcd(int x, int y) {
	if (y == 0)return x;
	return gcd(y, x % y);
}
int lcm(int x, int y) {
	return x / gcd(x, y) * y;
}
int kai(int x, int y) {
	int res = 1;
	for (int i = x - y + 1; i <= x; i++) {
		res *= i; res %= mod;
	}
	return res;
}
int mod_pow(int x, int y, int m) {
	int res = 1;
	while (y) {
		if (y & 1) {
			res = res * x % m;
		}
		x = x * x % m;
		y >>= 1;
	}
	return res;
}
int comb(int x, int y) {
	if (y > x)return 0;
	return kai(x, y)* mod_pow(kai(y, y), mod - 2, mod) % mod;
}
struct edge { int to, cost; };
int n, q;
int t[114514];
double a[114514];
int l[114514], r[114514];
pair<int, double>memo[114514];
signed main() {
	cin >> n;
	rep(i, n)cin >> t[i] >> a[i];
	cin >> q;
	rep(i, q)cin >> l[i] >> r[i];
	memo[0].first = t[0], memo[0].second = double(1 - a[0] / 10.0);
	for (int i = 1; i < n; i++) {
		memo[i].first = t[i];
		memo[i].second = double(memo[i - 1].second * (double(1 - a[i] / 10.0)));
	}
	rep(i, q) {
		int x = lower_bound(t, t + n, l[i]) - t - 1;
		int y = upper_bound(t, t + n, r[i]) - t - 1;
		double pp = 10000, qq = 10000;
		if (x >= 0)pp = memo[x].second;
		if (y >= 0)qq = memo[y].second;
		pp = min(pp, (double)1), qq = min(qq, (double)1);
		cout << setprecision(15) << double(qq / pp) * key << endl;
	}
	ggr
}


