#include <vector>
#include <iostream>
#include<map>
#include<cmath>
#include<bitset>
using namespace std;
const int N = 1e3 + 10;
typedef pair<int, int> PII;
const double eps = 1e-6;
int n, m, k;
struct Node {
int x, y;
int r, cnt;
}cir[N], node[N];
bitset<N> st[N];
bool dist (int a, int b) {
double dis1 = node[a].x - cir[b].x;
double dis2 = node[a].y - cir[b].y;
double dif = sqrt(dis1 * dis1 + dis2 * dis2);
return dif <= cir[b].r - eps;
}
int main () {
cin >> n >> m >> k;
for (int i = 1; i<= n ;i ++) {
cin >> node[i].x >> node[i].y;
}
for (int i = 0; i < m ;i ++) {
cin >> cir[i].r;
cin >> cir[i].x >> cir[i].y;
}
for (int i = 1; i <= n ;i ++) {
for (int j = 0; j < m; j ++) {
st[i][j] = dist(i, j);
}
}
while(k --) {
int a, b;
cin >> a >> b;
cout << (st[a]^st[b]).count() << endl;
}
return 0;
}
O(nk/32)用bitset表示状态 用stl优化