Submission #1187031


Source Code Expand

import java.lang.*;
import java.io.*;
import java.util.*;


public class Main {

	public static void main(String[] args) throws java.lang.Exception {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskA solver = new TaskA();
		solver.solve(in, out);
		out.close();
	}
}

class TaskA {

	public void solve(InputReader in, PrintWriter out) {
		int a = in.nextInt(), b = in.nextInt(), h = in.nextInt();
		int ans = (a + b) * (h / 2);
		out.println(ans);
	}
}

class InputReader {
	public BufferedReader reader;
	public StringTokenizer tokenizer;

	public InputReader(InputStream stream) {
		reader = new BufferedReader(new InputStreamReader(stream), 32768);
		tokenizer = null;
	}

	public String next() {
		while (tokenizer==null || !tokenizer.hasMoreTokens()) {
			try {
				tokenizer = new StringTokenizer(reader.readLine());
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}
		return tokenizer.nextToken();
	}

	public int nextInt() {
		return Integer.parseInt(next());
	}
}

Submission Info

Submission Time
Task A - Trapezoids
User Trasier
Language Java8 (OpenJDK 1.8.0)
Score 100
Code Size 1184 Byte
Status AC
Exec Time 73 ms
Memory 21588 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 100 / 100
Status
AC × 2
AC × 7
Set Name Test Cases
Sample sample_01.txt, sample_02.txt
All 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, sample_01.txt, sample_02.txt
Case Name Status Exec Time Memory
01.txt AC 72 ms 19284 KB
02.txt AC 70 ms 20564 KB
03.txt AC 70 ms 18132 KB
04.txt AC 71 ms 21332 KB
05.txt AC 72 ms 21332 KB
sample_01.txt AC 73 ms 21332 KB
sample_02.txt AC 71 ms 21588 KB