6
12 8 12 17 20 5
17 4 8 8 8 4
 6
4 1 12 9 3 11
12 20 19 12 19 11
 1
1
1
 2
1 2
1 1
 1
7
5
 6
16 20 18 7 14 2
17 12 4 10 7 4

705
 917
 1
 9
 5
 741

import java.util.Scanner;

public class Vasya {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner input = new Scanner ( System.in );
		int column = input.nextInt();
		input.nextLine();
		int[][] array = new int[2][column];
		for(int i=0 ; i<array.length ; i++){
			for(int ii=0 ; ii<array[0].length ; ii++){
				array[i][ii] = input.nextInt();
			}
			input.nextLine();
		}
		input.close();
		process(array);

	}

	public static void process(int[][] array){
		//go right left
		int rightLeft = 0;

		int multiplier=-1;
		//go right
		for(int i=0 ; i<array[0].length ; i++){
			rightLeft+=array[0][i]*++multiplier;
			System.out.println(rightLeft);
		}
		//go left
		for(int j=array[0].length-1 ; j>=0 ; j--){
			rightLeft+=array[1][j]*++multiplier;
			System.out.println(rightLeft);
		}

		 multiplier=-1;

		int upDown = 0;
		for( int i=0 ; i<array[0].length ; i++){
			if(i%2==0){
				upDown+=array[0][i]*++multiplier;
				upDown+=array[1][i]*++multiplier;
			}
			else{
				upDown+=array[1][i]*++multiplier;
				upDown+=array[0][i]*++multiplier;
			}
		}

		System.out.println(Math.max(rightLeft, upDown));


	}

}