#include #include using namespace std; class point{ public: int x; int y; }; int main(){ int r,c,n,m; cin >> r >>c >> n >> m; if(r < 1){ cout << "r too small" << endl; return 1; } if(r > 10000) { cout << "r too large" << endl; return 2; } if(c < 1) { cout << "c too small" << endl; return 3; } if(c > 10000) { cout << "c too large" << endl; return 4; } if(n < 0) { cout << "n too small" << endl; return 5; } if(m < 0) { cout << "m too small" << endl; return 6; } if(m+n > 100) { cout << "m+n too large" << endl; return 7; } vector icons; for(int j = 0; j < m+n; j++){ int cur_r; int cur_c; cin >> cur_r >> cur_c; if(cur_r < 0) { cout << "Book: " << j << " r too low"; return 8; } if(cur_r >= r) { cout << "Book: " << j << " r too high"; return 9; } if(cur_c < 0) { cout << "Book: " << j << " c too low"; return 10; } if(cur_c >= c) { cout << "Book: " << j << " c too high"; return 11; } point p; p.x = cur_r; p.y = cur_c; icons.push_back(p); } for(int j = 0; j < icons.size(); j++) for(int k = 0; k < icons.size(); k++){ if(j != k && icons[j].x == icons[k].x && icons[j].y == icons[k].y) { cout << "Book: " << j << " and " << k << " have the same position" << endl; return 12; } } return 42; }