Language: C++

#include <stdio.h>
#include <iostream>
#include <vector>
#define or0(a) (a)<0?0:(a)
using namespace std;

int main(){
	int an, bn, r, ans = 0, d, b0, b1;
	vector< vector<int> > a;
	scanf("%d %d %d", &an, &bn, &r);
	a.resize(10000);
	for (int i = 0; i < a.size(); i++){
		a[i].resize(313);
	}
	while (an){
		d = 16 * r * r;
		for (int i = 0; i < an; i++){
			int tmp1, tmp2;
			scanf("%d %d", &tmp1, &tmp2);
			a[tmp1][tmp2 / 32] |= 1 << (tmp2 % 32);
		}
		for (int i = 0; i < bn; i++){
			scanf("%d %d", &b0, &b1);
			for (int idxx = or0(b0 - 4 * r); idxx <= b0 + 4 * r && idxx < 10000; idxx++){
				for (int idxy = or0(b1 - 4 * r); idxy <= b1 + 4 * r && idxy < 10000; idxy++){
					if ((a[idxx][idxy / 32] >> (idxy % 32)) & 1){
						if ((idxx - b0)*(idxx - b0) + (idxy - b1)*(idxy - b1) <= d){
							ans++;
						}
					}
				}
			}
		}
		printf("%d\n", ans);
		fill(a.begin(), a.end(), 0);
		ans = 0;
		scanf("%d %d %d", &an, &bn, &r);
	}
	return 0;
}

Compiler output:
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_algobase.h: In instantiation of 'typename __gnu_cxx::__enable_if<std::__is_scalar<_Tp>::__value, void>::__type std::__fill_a1(_ForwardIterator, _ForwardIterator, const _Tp&) [with _ForwardIterator = vector<int>*; _Tp = int; typename __gnu_cxx::__enable_if<__is_scalar<_Tp>::__value, void>::__type = void]':
/usr/include/c++/14/bits/stl_algobase.h:981:21:   required from 'void std::__fill_a1(__gnu_cxx::__normal_iterator<_Iterator, _Container>, __gnu_cxx::__normal_iterator<_Iterator, _Container>, const _Tp&) [with _Ite = vector<int>*; _Cont = vector<vector<int> >; _Tp = int]'
  981 |     { std::__fill_a1(__first.base(), __last.base(), __value); }
      |       ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:998:21:   required from 'void std::__fill_a(_FIte, _FIte, const _Tp&) [with _FIte = __gnu_cxx::__normal_iterator<vector<int>*, vector<vector<int> > >; _Tp = int]'
  998 |     { std::__fill_a1(__first, __last, __value); }
      |       ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:1029:20:   required from 'void std::fill(_ForwardIterator, _ForwardIterator, const _Tp&) [with _ForwardIterator = __gnu_cxx::__normal_iterator<vector<int>*, vector<vector<int> > >; _Tp = int]'
 1029 |       std::__fill_a(__first, __last, __value);
      |       ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:35:7:   required from here
   35 |                 fill(a.begin(), a.end(), 0);
      |                 ~~~~^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:952:18: error: no match for 'operator=' (operand types are 'std::vector<int>' and 'const int')
  952 |         *__first = __tmp;
      |         ~~~~~~~~~^~~~~~~
In file included from /usr/include/c++/14/vector:72,
                 from a.cc:3:
/usr/include/c++/14/bits/vector.tcc:210:5: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(const std::vector<_Tp, _Alloc>&) [with _Tp = int; _Alloc = std::allocator<int>]'
  210 |     vector<_Tp, _Alloc>::
      |     ^~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/vector.tcc:211:42: note:   no known conversion for argument 1 from 'const int' to 'const std::vector<int>&'
  211 |     operator=(const vector<_Tp, _Alloc>& __x)
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
In file included from /usr/include/c++/14/vector:66:
/usr/include/c++/14/bits/stl_vector.h:766:7: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::vector<_Tp, _Alloc>&&) [with _Tp = int; _Alloc = std::allocator<int>]'
  766 |       operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move())
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:766:26: note:   no known conversion for argument 1 from 'const int' to 'std::vector<int>&&'
  766 |       operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move())
      |                 ~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:788:7: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::initializer_list<_Tp>) [with _Tp = int; _Alloc = std::allocator<int>]'
  788 |       operator=(initializer_list<value_type> __l)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:788:46: note:   no known conversion for argument 1 from 'const int' to 'std::initializer_list<int>'
  788 |       operator=(initializer_list<value_type> __l)
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~