Language: C++

/*
// PCK 2012 Q6 --- Mayan Crucial Prediction

#include <iostream>
#include <cstring>
#include <cstdlib>
#include "MDebug.h"
using namespace std;

const static int Manth_Day[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };

static const int MAX_B  = 13;
static const int MAX_KA = 20;
static const int MAX_T  = 20;
static const int MAX_W  = 18;
static const int MAX_KI = 20;

static const int MAX_DAY = 365;

int main()
{

	int  CalLength, DivCnt = 0, WordCnt = 0;
	int  B, KA, T, W, KI;
	int  Y, M, D;
	char Calendar[15];
	char Calendar_Indiv[5][13];
	bool MayanFlg;

	while( cin >> Calendar, Calendar[0] != '#' ) {

		CalLength = strlen( Calendar );
			
		for( int i = 0; i < CalLength; i++ ) {

			if( Calendar[i] != '.' ) {
				Calendar_Indiv[DivCnt][WordCnt] = Calendar[i];
			}
			else {
				DivCnt++;
				WordCnt = 0;
				continue;
			}

			WordCnt++;

		}

		if( strlen( Calendar_Indiv[0] ) >= 4 ) {

			Y = atoi( Calendar_Indiv[0] );
			M = atoi( Calendar_Indiv[1] );
			D = atoi( Calendar_Indiv[2] );

			MayanFlg = false;

		}
		else {

			B  = atoi( Calendar_Indiv[0] );
			KA = atoi( Calendar_Indiv[1] );
			T  = atoi( Calendar_Indiv[2] );
			W  = atoi( Calendar_Indiv[3] );
			KI = atoi( Calendar_Indiv[4] );

			MayanFlg = true;

		}

		if( MayanFlg ) {

			int  sumKin = 0, tempKin;
			bool empty = false;

			Y = 2012;
			M = 12;
			D = 21;

			sumKin += ( ( B * MAX_KA * MAX_T * MAX_W * MAX_KI ) + ( KA * MAX_T * MAX_W * MAX_KI ) + ( T * MAX_W * MAX_KI ) + ( W * MAX_KI ) + KI );
			tempKin = sumKin;

			while( true ) {

				if( sumKin == 0 ) { empty = true; break; }
				else if( D == 32 ) { Y++; M = 1; D = 1; break; }

				D++;
				sumKin--;

			}

			while( true ) {

				if( !( Y % 4 ) && ( ( Y % 100 ) || !( Y % 400 ) ) ) {

					if( sumKin - ( MAX_DAY + 1 ) < 0 ) break;

					sumKin -= ( MAX_DAY + 1 );
					Y++;

				}
				else if( sumKin - MAX_DAY < 0 ) break;
				else {

					sumKin -= MAX_DAY;
					Y++;

				}

			}

			while( true ) {

				if( !( Y % 4 ) && ( ( Y % 100 ) || !( Y % 400 ) ) ) {
					for( int i = 0; i < 12; i++ ) {

						if( sumKin - ( Manth_Day[i] == 28 ? Manth_Day[i] + 1 : Manth_Day[i] ) < 0 ) break;
						sumKin -= ( Manth_Day[i] == 28 ? Manth_Day[i] + 1 : Manth_Day[i] );
						M++;

					}
				}
				else {
					for( int i = 0; i < 12; i++ ) {

						if( sumKin - Manth_Day[i] < 0 ) break;
						sumKin -= Manth_Day[i];
						M++;

					}
				}
							

			}

			D += sumKin;

		}
		
		cout << Y << ":" << M << ":" << D << endl;

	}

	return 0;

}
*/

#include<iostream>
#include<algorithm>
using namespace std;

#define REP(i,a) for( int i = 0; i < a; i++ )

void AAA(int,int,int);

int pipe[65001];
int joi[65002], kanemax = -1;
int nagasa = 0;
int sosu = 0;

int main()
{

	int n;

	cin >> n;
	while( n != 0 ){
		REP( i, n ){
			cin >> pipe[i];
			nagasa += pipe[i];
		}
		REP( i, n - 1 ){
			cin >> joi[i];
		}
		sosu = n;
		AAA( sosu, nagasa, 0 );

		cout << kanemax << endl;
		nagasa = 0;
		kanemax = 0;
		cin >> n;
	}
	return 0;
}
void AAA( int a, int b, int c )
{
	if( c == n ){
		if( kanemax < b * a ) kanemax = b * a;
	}
	else{

		AAA( a - 1, b + joi[c], c + 1 ); 
		AAA( a, b, c + 1 );
	}
}

Compiler output:
a.cc: In function 'void AAA(int, int, int)':
a.cc:188:18: error: 'n' was not declared in this scope
  188 |         if( c == n ){
      |                  ^