Problem:
Score : 100 points

Problem Statement

You are given a trapezoid. The lengths of its upper base, lower base, and height are a, b, and h, respectively.

An example of a trapezoid

Find the area of this trapezoid.

Constraints

1≦a≦100

1≦b≦100

1≦h≦100

All input values are integers.

h is even.

Input

The input is given from Standard Input in the following format:

a
b
h

Output

Print the area of the given trapezoid. It is guaranteed that the area is an integer.

Sample Input 1

3
4
2

Sample Output 1

7

When the lengths of the upper base, lower base, and height are 3, 4, and 2, respectively, the area of the trapezoid is (3+4)×2/2 = 7.

Sample Input 2

4
4
4

Sample Output 2

16

In this case, a parallelogram is given, which is also a trapezoid.

Solution in C (GCC 5.4.1) (judge verdict: Time Limit Exceeded)

#include <stdio.h>
#include <string.h>

int main(void)
{
	char sa[100],sb[100],sc[100];
	int ca[1]={0},cb[1]={0},cc[1]={0};
	scanf("%s%s%s",sa,sb,sc);
	int lena,lenb,lenc;
	lena=strlen(sa);
	lenb=strlen(sb);
	lenc=strlen(sc);
	
	char win='z';
	char turn='a';
	while(win=='z'){
		switch(turn)
		{
		case 'a':
			if(ca[0]==lena)
				{win='A';}

			turn=sa[ca[0]];
			ca[0]++;
			break;
		case 'b':
			if(cb[0]==lenb)
				{win='B';}
			turn=sb[cb[0]];
			cb[0]++;
			break;
		case 'c':
			if(cc[0]==lenc)
				{win='C';}
			turn=sc[cc[0]];
			cc[0]++;
			break;
		}
		}
	printf("%c\n",win);
	return 0;
}