Language: C++

#include <bits/stdc++.h>
#define FOR(i,n) for(int i=0;i<(int)(n);i++)
#define FORR(i,m,n) for(int i=(int)(m);i<(int)(n);i++)
#define pb(a) push_back(a)
#define mp(x,y) make_pair(x,y)
#define ZERO(a) memset(a,0,sizeof(a))
#define len(a) sizeof(a)
#define ll long long
#define INF 1<<29
#define MAX_M 201
#define MAX_N 1111
typedef pair<int,int> pii
using namespace std;

int x1[MAX_M],y1[MAX_M],x2[MAX_N],y2[MAX_N];

void solve(){
 int m,n;
 for(;;){
  cin>>m;
  if(!m) break;
  set<pii> st;
  vector<pii> v;
  FOR(i,m) cin>>x1[i]>>y1[i];
  cin>>n;
  FOR(i,n){
   cin>>x2[i]>>y2[i];
   st.insert(mp(x2[i],y2[i]));
  }
  FOR(i,m){
   v.pb(mp(x1[i]-x1[0],y1[i]-y1[0]));
  }
  set<pii>::iterator ite;
  FOR(i,n){
   bool f=true;
   FOR(j,v.size()){
    ite=st.find(mp(v[j].first+x2[i],v[j].second+y2[i]));
    if(ite==st.end()){
     f=false;
     break;
    }
   }
   if(f){
    cout<<x2[i]-x1[0]<<y2[i]-y1[0]<<endl;
    break;
   }
  }
 }
}

int main(){
 solve();
 return 0;
}

Compiler output:
a.cc:12:9: error: 'pair' does not name a type
   12 | typedef pair<int,int> pii
      |         ^~~~
a.cc:15:23: error: 'int y1 [201]' redeclared as different kind of entity
   15 | int x1[MAX_M],y1[MAX_M],x2[MAX_N],y2[MAX_N];
      |                       ^
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/cassert:43,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:33,
                 from a.cc:1:
/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 solve()':
a.cc:20:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   20 |   cin>>m;
      |   ^~~
      |   std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:22:3: error: 'set' was not declared in this scope
   22 |   set<pii> st;
      |   ^~~
a.cc:22:3: note: suggested alternatives:
In file included from /usr/include/c++/14/set:63,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:158:
/usr/include/c++/14/bits/stl_set.h:96:11: note:   'std::set'
   96 |     class set
      |           ^~~
/usr/include/c++/14/set:87:13: note:   'std::pmr::set'
   87 |       using set = std::set<_Key, _Cmp, polymorphic_allocator<_Key>>;
      |             ^~~
a.cc:22:7: error: 'pii' was not declared in this scope
   22 |   set<pii> st;
      |       ^~~
a.cc:22:12: error: 'st' was not declared in this scope; did you mean 'std'?
   22 |   set<pii> st;
      |            ^~
      |            std
a.cc:23:3: error: 'vector' was not declared in this scope
   23 |   vector<pii> v;
      |   ^~~~~~
a.cc:23:3: note: suggested alternatives:
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53:
/usr/include/c++/14/bits/stl_vector.h:428:11: note:   'std::vector'
  428 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
/usr/include/c++/14/vector:93:13: note:   'std::pmr::vector'
   93 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
      |             ^~~~~~
a.cc:23:15: error: 'v' was not declared in this scope
   23 |   vector<pii> v;
      |               ^
a.cc:24:28: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   24 |   FOR(i,m) cin>>x1[i]>>y1[i];
      |                            ^
a.cc:5:17: error: 'make_pair' was not declared in this scope; did you mean 'std::make_pair'?
    5 | #define mp(x,y) make_pair(x,y)
      |                 ^~~~~~~~~
a.cc:28:14: note: in expansion of macro 'mp'
   28 |    st.insert(mp(x2[i],y2[i]));
      |              ^~
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
                 from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/bits/stl_pair.h:1132:5: note: 'std::make_pair' declared here
 1132 |     make_pair(_T1&& __x, _T2&& __y)
      |     ^~~~~~~~~
a.cc:31:28: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   31 |    v.pb(mp(x1[i]-x1[0],y1[i]-y1[0]));
      |                            ^
a.cc:4:25: note: in definition of macro 'pb'
    4 | #define pb(a) push_back(a)
      |                         ^
a.cc:31:9: note: in expansion of macro 'mp'
   31 |    v.pb(mp(x1[i]-x1[0],y1[i]-y1[0]));
      |         ^~
a.cc:31:34: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   31 |    v.pb(mp(x1[i]-x1[0],y1[i]-y1[0]));
      |                                  ^
a.cc:4:25: note: in definition of macro 'pb'
    4 | #define pb(a) push_back(a)
      |                         ^
a.cc:31:9: note: in expansion of macro 'mp'
   31 |    v.pb(mp(x1[i]-x1[0],y1[i]-y1[0]));
      |         ^~
a.cc:31:29: error: ISO C++ forbids using pointer to a function in subtraction [-fpermissive]
   31 |    v.pb(mp(x1[i]-x1[0],y1[i]-y1[0]));
      |                        ~~~~~^~~~~~
a.cc:4:25: note: in definition of macro 'pb'
    4 | #define pb(a) push_back(a)
      |                         ^
a.cc:31:9: note: in expansion of macro 'mp'
   31 |    v.pb(mp(x1[i]-x1[0],y1[i]-y1[0]));
      |         ^~
a.cc:5:17: error: 'make_pair' was not declared in this scope; did you mean 'std::make_pair'?
    5 | #define mp(x,y) make_pair(x,y)
      |                 ^~~~~~~~~
a.cc:4:25: note: in definition of macro 'pb'
    4 | #define pb(a) push_back(a)
      |                         ^
a.cc:31:9: note: in expansion of macro 'mp'
   31 |    v.pb(mp(x1[i]-x1[0],y1[i]-y1[0]));
      |         ^~
/usr/include/c++/14/bits/stl_pair.h:1132:5: note: 'std::make_pair' declared here
 1132 |     make_pair(_T1&& __x, _T2&& __y)
      |     ^~~~~~~~~
a.cc:33:13: error: '::iterator' has not been declared; did you mean 'std::iterator'?
   33 |   set<pii>::iterator ite;
      |             ^~~~~~~~
      |             std::iterator
In file included from /usr/include/c++/14/bits/stl_algobase.h:65:
/usr/include/c++/14/bits/stl_iterator_base_types.h:127:34: note: 'std::iterator' declared here
  127 |     struct _GLIBCXX17_DEPRECATED iterator
      |                                  ^~~~~~~~
a.cc:37:5: error: 'ite' was not declared in this scope
   37 |     ite=st.find(mp(v[j].first+x2[i],v[j].second+y2[i]));
      |     ^~~
a.cc:5:17: error: 'make_pair' was not declared in this scope; did you mean 'std::make_pair'?
    5 | #define mp(x,y) make_pair(x,y)
      |                 ^~~~~~~~~
a.cc:37:17: note: in expansion of macro 'mp'
   37 |     ite=st.find(mp(v[j].first+x2[i],v[j].second+y2[i]));
      |                 ^~
/usr/include/c++/14/bits/stl_pair.h:1132:5: note: 'std::make_pair' declared here
 1132 |     make_pair(_T1&& __x, _T2&& __y)
      |     ^~~~~~~~~
a.cc:44:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   44 |     cout<<x2[i]-x1[0]<<y2[i]-y1[0]<<endl;
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:44:34: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   44 |     cout<<x2[i]-x1[0]<<y2[i]-y1[0]<<endl;
      |                                  ^
a.cc:44:29: error: invalid operands of types 'int' and 'double(double) noexcept' to binary 'operator-'
   44 |     cout<<x2[i]-x1[0]<<y2[i]-y1[0]<<endl;
      |                        ~~~~~^~~~~~
      |                            |     |
      |                            int   double(double) noexcept
a.cc:44:37: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   44 |     cout<<x2[i]-x1[0]<<y2[i]-y1[0]<<endl;
      |                                     ^~~~
      |                                     std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~