Language: C++

#include<bits/stdc++.h>

#define INF 1e9
#define llINF 1e18
#define MOD 1000000007
#define pb push_back
#define mp make_pair 
#define F first
#define S second
#define ll long long
#define ALL(a) (a).begin(),(a).end()
#define Yes(hoge) cout<<((hoge)?"Yes":"No")<<endl;
#define YES(hoge) cout<<((hoge)?"YES":"NO")<<endl;
using namespace std;


int main(){
  int n;cin>>n;
  vector<pair<int,int> >place(n);
  int ma=0;
  bool ki=false;
  bool gu=false;
  for(int i=0;i<n;i++){
    cin>>place[i].F>>place[i].S;
    if((abs(place[i].F)+abs(place[i].S))%2)ki=true;
    if((abs(place[i].F)+abs(place[i].S))%2==0)gu=true;
    ma=max(ma,abs(place[i].F)+abs(place[i].S));
  }
  if(ki&&gu){
    cout<<-1<<endl;
    return 0;
  }
  if(gu){
    cout<<40<<endl;
    for(int i=0;i<40;i++){
      cout<<1;
      if(i!=39)cout<<" ";
      cout<<endl;
    for(int i=0;i<n;i++){
      int x=place[i].F,y=place[i].S;
      if(x%2){
	if(x>0){
	  int num=19-x;
	  for(int j=0;j<x;j++)
	    cout<<"R";
	  for(int j=0;j<num/2;j++)
	    cout<<"LR";
	}else if(x<0){
	  int num=19-abs(x);
	  for(int j=0;j<abs(x);j++)
	    cout<<"L";
	  for(int j=0;j<num/2;j++)
	    cout<<"LR";
	}

	if(y>0){
	  int num=21-y;
	  for(int j=0;j<y;j++)
	    cout<<"U";
	  for(int j=0;j<num/2;j++)
	    cout<<"UD";
	}else if(y<0){
	  int num=21-abs(y);
	  for(int j=0;j<abs(y);j++)
	    cout<<"D";
	  for(int j=0;j<num/2;j++)
	    cout<<"UD";
	}

      }else{
	if(x>0){
	  int num=20-x;
	  for(int j=0;j<x;j++)
	    cout<<"R";
	  for(int j=0;j<num/2;j++)
	    cout<<"LR";
	}else if(x<0){
	  int num=20-abs(x);
	  for(int j=0;j<abs(x);j++)
	    cout<<"L";
	  for(int j=0;j<num/2;j++)
	    cout<<"LR";
	}

	if(y>0){
	  int num=20-y;
	  for(int j=0;j<y;j++)
	    cout<<"U";
	  for(int j=0;j<num/2;j++)
	    cout<<"UD";
	}else if(y<0){
	  int num=20-abs(y);
	  for(int j=0;j<abs(y);j++)
	    cout<<"D";
	  for(int j=0;j<num/2;j++)
	    cout<<"UD";
	}

      }
    }
  }else{
    cout<<39<<endl;
    for(int i=0;i<39;i++){
      cout<<1;
      if(i!=38)cout<<" ";
      cout<<endl;
    for(int i=0;i<n;i++){
      int x=place[i].F,y=place[i].S;
      if(x%2){
	if(x>0){
	  int num=19-x;
	  for(int j=0;j<x;j++)
	    cout<<"R";
	  for(int j=0;j<num/2;j++)
	    cout<<"LR";
	}else if(x<0){
	  int num=19-abs(x);
	  for(int j=0;j<abs(x);j++)
	    cout<<"L";
	  for(int j=0;j<num/2;j++)
	    cout<<"LR";
	}

	if(y>0){
	  int num=20-y;
	  for(int j=0;j<y;j++)
	    cout<<"U";
	  for(int j=0;j<num/2;j++)
	    cout<<"UD";
	}else if(y<0){
	  int num=20-abs(y);
	  for(int j=0;j<abs(y);j++)
	    cout<<"D";
	  for(int j=0;j<num/2;j++)
	    cout<<"UD";
	}

      }else{
	if(x>0){
	  int num=20-x;
	  for(int j=0;j<x;j++)
	    cout<<"R";
	  for(int j=0;j<num/2;j++)
	    cout<<"LR";
	}else if(x<0){
	  int num=20-abs(x);
	  for(int j=0;j<abs(x);j++)
	    cout<<"L";
	  for(int j=0;j<num/2;j++)
	    cout<<"LR";
	}

	if(y>0){
	  int num=19-y;
	  for(int j=0;j<y;j++)
	    cout<<"U";
	  for(int j=0;j<num/2;j++)
	    cout<<"UD";
	}else if(y<0){
	  int num=19-abs(y);
	  for(int j=0;j<abs(y);j++)
	    cout<<"D";
	  for(int j=0;j<num/2;j++)
	    cout<<"UD";
	}

      }
      cout<<endl;
    }
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:101:4: error: expected '}' before 'else'
  101 |   }else{
      |    ^~~~
a.cc:33:9: note: to match this '{'
   33 |   if(gu){
      |         ^
a.cc:172:2: error: expected '}' at end of input
  172 | }
      |  ^
a.cc:17:11: note: to match this '{'
   17 | int main(){
      |           ^