Language: C++

#include <bits/stdc++.h>

using namespace std;

long long int zizyo(int a,int b){
  if(b==0){return 1;}
  else if(b==1){return a;}
  else{
  return a*zizyo(a,b-1);}
}

int main(){
 int n,m;
  cin>>n>>m;
  int a[n];
  
  for(int i=0;i<n;i++){
    cin>>a[i];}

   int num[n] = {0};  
    for (int i = 0; i < n; ++i) {
        num[a[i]]++;  
    }
  
  
  
 if(num[1]){if (n%2==0){int a=n/2;
        long long int kotae=0;
              for(int i=0;i<a;i++){
                kotae+=zizyo(10,i);}
              cout<<kotae<<endl;}
   
   
  else{ if(num[7]){int a=n/2;
        long long int kotae=0;
              for(int i=0;i<a-1;i++){
                kotae+=zizyo(10,i);}
              kotae+=7*zizyo(10,a-1);
              cout<<kotae<<endl;}
              
  else if(num[2]||num[3]||num[5])
  {if(num[5]){int a=n/2;
        long long int kotae=0;
              for(int i=0;i<a-2;i++){
                kotae+=zizyo(10,i);}
              kotae+=5*zizyo(10,a-2);
              cout<<kotae<<endl;}
   else if(num[3]){int a=n/2;
        long long int kotae=0;
              for(int i=0;i<a-1;i++){
                kotae+=zizyo(10,i);}
              kotae+=3*zizyo(10,a-2);
              cout<<kotae<<endl;}
    else if(num[2]){int a=n/2;
        long long int kotae=0;
              for(int i=0;i<a-1;i++){
                kotae+=zizyo(10,i);}
              kotae+=2*zizyo(10,a-2);
              cout<<kotae<<endl;}
  }
   else{int a=n/2;
        long long int kotae=0;
              for(int i=0;i<a-3;i++){
                kotae+=zizyo(10,i);}
              kotae+=8*zizyo(10,a-3);
              cout<<kotae<<endl;}
 }
           }
   
   
  
  
 else if(num[7]){if(n%3==0){int a=n/3;
        long long int kotae=0;
              for(int i=0;i<a;i++){
                kotae+=zizyo(10,i);}
              cout<<kotae<<endl;}
   
  else{ if(num[4]){int a=n/3;
        long long int kotae=0;
              for(int i=0;i<a-1;i++){
                kotae+=zizyo(10,i);}
              kotae+=7*zizyo(10,a-1);
              cout<<kotae<<endl;}
  else if(num[2]||num[3]||num[5])
  {if(num[5]){int a=n/3;
        long long int kotae=0;
              for(int i=0;i<a-2;i++){
                kotae+=zizyo(10,i);}
              kotae+=5*zizyo(10,a-2);
              cout<<kotae<<endl;}
   else if(num[3]){int a=n/2;
        long long int kotae=0;
              for(int i=0;i<a-2;i++){
                kotae+=zizyo(10,i);}
              kotae+=3*zizyo(10,a-2);
              cout<<kotae<<endl;}
    else if(num[2]){int a=n/2;
        long long int kotae=0;
              for(int i=0;i<a-2;i++){
                kotae+=zizyo(10,i);}
              kotae+=2*zizyo(10,a-2);
              cout<<kotae<<endl;}
     else{int a=n/2;
        long long int kotae=0;
              for(int i=0;i<a-3;i++){
                kotae+=zizyo(10,i);}
              kotae+=8*zizyo(10,a-3);
              cout<<kotae<<endl;}
  }
      }
   
   
  else if(num[2]&&num[3]&&num[5]){  
    
    
    
   else if(num[6]&&num[9]){ 
    else if(num[8]){
   
 
  
 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:114:3: error: expected '}' before 'else'
  114 |   else if(num[2]&&num[3]&&num[5]){
      |   ^~~~
a.cc:73:17: note: to match this '{'
   73 |  else if(num[7]){if(n%3==0){int a=n/3;
      |                 ^
a.cc:118:4: error: expected '}' before 'else'
  118 |    else if(num[6]&&num[9]){
      |    ^~~~
a.cc:114:34: note: to match this '{'
  114 |   else if(num[2]&&num[3]&&num[5]){
      |                                  ^
a.cc:119:5: error: expected '}' before 'else'
  119 |     else if(num[8]){
      |     ^~~~
a.cc:118:27: note: to match this '{'
  118 |    else if(num[6]&&num[9]){
      |                           ^
a.cc:124:2: error: expected '}' at end of input
  124 | }
      |  ^
a.cc:12:11: note: to match this '{'
   12 | int main(){
      |           ^