Language: C++

#include <bits/stdc++.h>

using namespace std;

long long int sei(long long int n){
  if(n>=0) return n;
  else return 10000000000003;}


int main(){
 int a,b,q;
  cin>>a>>b>>q;
  long long int sbasyo[a],tbasyo[b],syoki[q];
  for(int i=0;i<a;i++){
    cin>>sbasyo[i];}
 for(int i=0;i<b;i++){
    cin>>tbasyo[i];}
  for(int i=0;i<q;i++){
    cin>>syoki[i];}
  
  for(int j=0;j<q;j++){
    
  long long int ssmoyori=100000000001;
   long long int sbmoyori=100000000001;
   long long int tsmoyori=100000000001;
   long long int tbmoyori=100000000001;
  
     for(int i=0;i<a;i++){
       int p=i-1
     if(ssmoyori>sei(sbasyo[i]-syoki[j]))
     {ssmoyori=sbasyo[i]-syoki[j];}
      if(i>=1){
       if((sei(sbasyo[p]-syoki[j])==10000000000003 && sei(sbasyo[i]-syoki[j])!=10000000000003)  || (sei(sbasyo[p]-syoki[j])!=10000000000003 && sei(sbasyo[i]-syoki[j])==10000000000003)) 
       break;
      }
  }
      
  
    
      for(int i=0;i<a;i++){
        int p=i-1
     if(sbmoyori>sei(sbasyo[i]-syoki[j]))
       sbmoyori=sbasyo[i]-syoki[j];
        if(i>=1){
       if((sei(syoki[j]-sbasyo[p])==10000000000003 && sei(syoki[j]-sbasyo[i])!=10000000000003)  || (sei(syoki[j]-sbasyo[p])!=10000000000003 && sei(syoki[j]-sbasyo[i])==10000000000003)) 
       break;
      }
  }
    
     for(int i=0;i<a;i++){
       int p=i-1
     if(tsmoyori>sei(syoki[j]-tbasyo[i]))
       tsmoyori=syoki[j]-tbasyo[i];if(i>=1){
       if((sei(tbasyo[p]-syoki[j])==10000000000003 && sei(tbasyo[i]-syoki[j])!=10000000000003)  || (sei(tbasyo[p]-syoki[j])!=10000000000003 && sei(tbasyo[i]-syoki[j])==10000000000003)) 
       break;
      }
  }
    
      for(int i=0;i<a;i++){
        int p=i-1
     if(tbmoyori>sei(tbasyo[i]-syoki[j]))
       tbmoyori=tbasyo[i]-syoki[j];
         if((sei(tbasyo[p]-syoki[j])==10000000000003 && sei(tbasyo[i]-syoki[j])!=10000000000003)  || (sei(tbasyo[p]-syoki[j])!=10000000000003 && sei(tbasyo[i]-syoki[j])==10000000000003)) 
       break;
      }
  }


    
long long int moyoris =max(ssmoyori,tsmoyori);
    long long int moyorib =max(sbmoyori,tbmoyori);
    

   
      long long int saitan1=min(2*ssmoyori+tbmoyori,2*sbmoyori+tsmoyori);
              long long int saitan2=min(ssmoyori+2*tbmoyori,sbmoyori+2*tsmoyori);
            long long int saitan3=min(moyoris,moyorib);
    long long int saitan4=min(saitan1,saitan2);
      long long int saitan5=min(saitan3,saitan4);
  
    
     cout<<saitan5<<endl;
  
  }
    
    
  
  
  
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:30:6: error: expected ',' or ';' before 'if'
   30 |      if(ssmoyori>sei(sbasyo[i]-syoki[j]))
      |      ^~
a.cc:42:6: error: expected ',' or ';' before 'if'
   42 |      if(sbmoyori>sei(sbasyo[i]-syoki[j]))
      |      ^~
a.cc:52:6: error: expected ',' or ';' before 'if'
   52 |      if(tsmoyori>sei(syoki[j]-tbasyo[i]))
      |      ^~
a.cc:61:6: error: expected ',' or ';' before 'if'
   61 |      if(tbmoyori>sei(tbasyo[i]-syoki[j]))
      |      ^~
a.cc:70:28: error: 'ssmoyori' was not declared in this scope
   70 | long long int moyoris =max(ssmoyori,tsmoyori);
      |                            ^~~~~~~~
a.cc:70:37: error: 'tsmoyori' was not declared in this scope
   70 | long long int moyoris =max(ssmoyori,tsmoyori);
      |                                     ^~~~~~~~
a.cc:71:32: error: 'sbmoyori' was not declared in this scope
   71 |     long long int moyorib =max(sbmoyori,tbmoyori);
      |                                ^~~~~~~~
a.cc:71:41: error: 'tbmoyori' was not declared in this scope
   71 |     long long int moyorib =max(sbmoyori,tbmoyori);
      |                                         ^~~~~~~~
a.cc: At global scope:
a.cc:91:1: error: expected declaration before '}' token
   91 | }
      | ^