Language: C++

#define _USE_MATH_DEFINES
#include <iostream>
#include <memory>
#include <memory.h>
#include <fstream>
#include <cmath>
#include <numeric>
#include <vector>
#include <stack>
#include <string>
#include <queue>
#include <sstream>
#include <cstdlib>
#include <cassert>
#include <cstdio>
#include <cstring>
#include <map>
#include <set>
#include <iomanip>
#include <list>
#include <cctype>
#include <algorithm>
#include <complex>
using namespace std;

typedef complex<double> xy_t;
typedef pair<xy_t, xy_t> line;
typedef long long ll;
typedef pair<int, int> P;
typedef pair<double, double> Pd;
typedef pair<int, P> PP;
typedef pair<int, PP> PPP;
const int INF = 1 << 28;
const double EPS = 1E-10;

#define rep(i, n) for(int i = 0; i < n; i++)
#define rep2(i, m, n) for(int i = m; i < n; i++)

string tag;
size_t cur;

map<int, string> tag_name;
vector<int> ch[200];

int x1[200];
int y1[200];
int x2[200];
int y2[200];

int res;

string get_name(){
	string res;
	while(tag[cur] != '>'){
		res.push_back(tag[cur++]);
	}
	return res;
}

int get_num(){
	int res = 0;
	while(isdigit(tag[cur])){
		res = res * 10 + tag[cur++] - '0';
	}
	return 0;
}

void get_size(int id){
	x1[id] = get_num();
	assert(tag[cur++] == ',');
	y1[id] = get_num();
	assert(tag[cur++] == ',');
	x2[id] = get_num();
	assert(tag[cur++] == ',');
	y2[id] = get_num();
}

void tag_con(int &id){
	int num = id;
	assert(tag[cur++] == '<');
	tag_name[id] = get_name();
	assert(tag[cur++] == '>');
	get_size(id);

	while(true){
		assert(tag[cur] == '<');
		char c = tag[cur+1];
		if(c == '/') break;
		ch[num].push_back(++id);
		tag_con(id);
	}
	while(tag[cur] != '>') cur++;
	cur++;
}

void get_tag(int x, int y, int id){
	if(x1[id] <= x && x <= x2[id] && y1[id] <= y && y <= y2[id]){
		res = id;
	}
	for(int i = 0; i < (int)ch[id].size(); i++){
		get_tag(x, y, ch[id][i]);
	}
}

int main(){
	int n, x, y;
	int cnt = 0;
	while(cin >> n && n){
		tag_name.clear();
		tag_name[120] = "OUT OF MAIN PANEL";
		ch[120].push_back(120);
		rep(i, 200) ch[i].clear();
		cur = 0;
		cnt = 0;
		getline(cin, tag);
		tag_con(cnt);
		cout << cnt << endl;
		rep(i, n){
			res = 120;
			cin >> x >> y;
			get_tag(x, y, 0);
			cout << tag_name[res] << " "<< ch[res].size() << endl;
		}
	}
	return 0;
}

Compiler output:
a.cc:46:11: error: 'int y1 [200]' redeclared as different kind of entity
   46 | int y1[200];
      |           ^
In file included from /usr/include/features.h:523,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/os_defines.h:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/c++config.h:683,
                 from /usr/include/c++/14/bits/requires_hosted.h:31,
                 from /usr/include/c++/14/iostream:38,
                 from a.cc:2:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:257:1: note: previous declaration 'double y1(double)'
  257 | __MATHCALL (y1,, (_Mdouble_));
      | ^~~~~~~~~~
a.cc: In function 'void get_size(int)':
a.cc:71:14: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   71 |         y1[id] = get_num();
      |              ^
a.cc:71:16: error: assignment of read-only location '*(y1 + ((sizetype)id))'
   71 |         y1[id] = get_num();
      |         ~~~~~~~^~~~~~~~~~~
a.cc: In function 'void get_tag(int, int, int)':
a.cc:97:47: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   97 |         if(x1[id] <= x && x <= x2[id] && y1[id] <= y && y <= y2[id]){
      |                                               ^
a.cc:97:49: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   97 |         if(x1[id] <= x && x <= x2[id] && y1[id] <= y && y <= y2[id]){
      |                                          ~~~~~~~^~~~