Language: C++

using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

class hawawa
{
  static Printer sw = new Printer(Console.OpenStandardOutput()) { AutoFlush = false };

  static void Main()
  {
    Console.SetOut(sw);
    solve();
    Console.Out.Flush();
  }

  static void solve()
  {
    Scanner scanner = new Scanner();
    int a = scanner.nextInt(), b = scanner.nextInt(), h = scanner.nextInt();
    Console.WriteLine((a + b) * h / 2);
  }
}

class Scanner
{
  string[] s;
  int i;


  char[] cs = new char[] { ' ' };

  public Scanner()
  {
    s = new string[0];
    i = 0;
  }

  public string next()
  {
    if (i < s.Length) return s[i++];
    string st = Console.ReadLine();
    while (st == "") st = Console.ReadLine();
    s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
    i = 0;
    return next();
  }

  public int nextInt()
  {
    return int.Parse(next());
  }

  public long nextLong()
  {
    return long.Parse(next());
  }

  public double nextDouble()
  {
    return double.Parse(next());
  }

}

class Printer : StreamWriter
{
  public override IFormatProvider FormatProvider { get { return CultureInfo.InvariantCulture; } }
  public Printer(Stream stream) : base(stream, new UTF8Encoding(false, true)) { }
  public Printer(Stream stream, Encoding encoding) : base(stream, encoding) { }
}

/// <summary>
/// Self-Balancing Binary Search Tree
/// (using Randamized BST)
/// </summary>
public class SB_BinarySearchTree<T> where T : IComparable
{
  public class Node
  {
    public T Value;
    public Node LChild;
    public Node RChild;
    public int Count;     //size of the sub tree

    public Node(T v)
    {
      Value = v;
      Count = 1;
    }
  }

  static Random _rnd = new Random();

  public static int Count(Node t)
  {
    return t == null ? 0 : t.Count;
  }

  static Node Update(Node t)
  {
    t.Count = Count(t.LChild) + Count(t.RChild) + 1;
    return t;
  }

  public static Node Merge(Node l, Node r)
  {
    if (l == null || r == null) return l == null ? r : l;

    if ((double)Count(l) / (double)(Count(l) + Count(r)) > _rnd.NextDouble())
    {
      l.RChild = Merge(l.RChild, r);
      return Update(l);
    }
    else
    {
      r.LChild = Merge(l, r.LChild);
      return Update(r);
    }
  }

  /// <summary>
  /// split as [0, k), [k, n)
  /// </summary>
  public static Tuple<Node, Node> Split(Node t, int k)
  {
    if (t == null) return new Tuple<Node, Node>(null, null);
    if (k <= Count(t.LChild))
    {
      var s = Split(t.LChild, k);
      t.LChild = s.Item2;
      return new Tuple<Node, Node>(s.Item1, Update(t));
    }
    else
    {
      var s = Split(t.RChild, k - Count(t.LChild) - 1);
      t.RChild = s.Item1;
      return new Tuple<Node, Node>(Update(t), s.Item2);
    }
  }

  public static Node Remove(Node t, T v)
  {
    if (Find(t, v) == null) return t;
    return RemoveAt(t, LowerBound(t, v));
  }

  public static Node RemoveAt(Node t, int k)
  {
    var s = Split(t, k);
    var s2 = Split(s.Item2, 1);
    return Merge(s.Item1, s2.Item2);
  }

  public static bool Contains(Node t, T v)
  {
    return Find(t, v) != null;
  }

  public static Node Find(Node t, T v)
  {
    while (t != null)
    {
      var cmp = t.Value.CompareTo(v);
      if (cmp > 0) t = t.LChild;
      else if (cmp < 0) t = t.RChild;
      else break;
    }
    return t;
  }

  public static Node FindByIndex(Node t, int idx)
  {
    if (t == null) return null;

    var currentIdx = Count(t) - Count(t.RChild) - 1;
    while (t != null)
    {
      if (currentIdx == idx) return t;
      if (currentIdx > idx)
      {
        t = t.LChild;
        currentIdx -= (Count(t == null ? null : t.RChild) + 1);
      }
      else
      {
        t = t.RChild;
        currentIdx += (Count(t == null ? null : t.LChild) + 1);
      }
    }

    return null;
  }

  public static int UpperBound(Node t, T v)
  {
    var torg = t;
    if (t == null) return -1;

    var ret = Int32.MaxValue;
    var idx = Count(t) - Count(t.RChild) - 1;
    while (t != null)
    {
      var cmp = t.Value.CompareTo(v);

      if (cmp > 0)
      {
        ret = Math.Min(ret, idx);
        t = t.LChild;
        idx -= (Count(t == null ? null : t.RChild) + 1);
      }
      else if (cmp <= 0)
      {
        t = t.RChild;
        idx += (Count(t == null ? null : t.LChild) + 1);
      }
    }
    return ret == Int32.MaxValue ? Count(torg) : ret;
  }

  public static int LowerBound(Node t, T v)
  {
    var torg = t;
    if (t == null) return -1;

    var idx = Count(t) - Count(t.RChild) - 1;
    var ret = Int32.MaxValue;
    while (t != null)
    {
      var cmp = t.Value.CompareTo(v);
      if (cmp >= 0)
      {
        if (cmp == 0) ret = Math.Min(ret, idx);
        t = t.LChild;
        if (t == null) ret = Math.Min(ret, idx);
        idx -= t == null ? 0 : (Count(t.RChild) + 1);
      }
      else if (cmp < 0)
      {
        t = t.RChild;
        idx += (Count(t == null ? null : t.LChild) + 1);
        if (t == null) return idx;
      }
    }
    return ret == Int32.MaxValue ? Count(torg) : ret;
  }

  public static Node Insert(Node t, T v)
  {
    var ub = LowerBound(t, v);
    return InsertByIdx(t, ub, v);
  }

  static Node InsertByIdx(Node t, int k, T v)
  {
    var s = Split(t, k);
    return Merge(Merge(s.Item1, new Node(v)), s.Item2);
  }

  public static IEnumerable<T> Enumerate(Node t)
  {
    var ret = new List<T>();
    Enumerate(t, ret);
    return ret;
  }

  static void Enumerate(Node t, List<T> ret)
  {
    if (t == null) return;
    Enumerate(t.LChild, ret);
    ret.Add(t.Value);
    Enumerate(t.RChild, ret);
  }
}

/// <summary>
/// C-like set
/// </summary>
public class Set<T> where T : IComparable
{
  protected SB_BinarySearchTree<T>.Node _root;

  public T this[int idx] { get { return ElementAt(idx); } }

  public int Count()
  {
    return SB_BinarySearchTree<T>.Count(_root);
  }

  public virtual void Insert(T v)
  {
    if (_root == null) _root = new SB_BinarySearchTree<T>.Node(v);
    else
    {
      if (SB_BinarySearchTree<T>.Find(_root, v) != null) return;
      _root = SB_BinarySearchTree<T>.Insert(_root, v);
    }
  }

  public void Clear()
  {
    _root = null;
  }

  public void Remove(T v)
  {
    _root = SB_BinarySearchTree<T>.Remove(_root, v);
  }

  public bool Contains(T v)
  {
    return SB_BinarySearchTree<T>.Contains(_root, v);
  }

  public T ElementAt(int k)
  {
    var node = SB_BinarySearchTree<T>.FindByIndex(_root, k);
    if (node == null) throw new IndexOutOfRangeException();
    return node.Value;
  }

  public int Count(T v)
  {
    return SB_BinarySearchTree<T>.UpperBound(_root, v) - SB_BinarySearchTree<T>.LowerBound(_root, v);
  }

  public int LowerBound(T v)
  {
    return SB_BinarySearchTree<T>.LowerBound(_root, v);
  }

  public int UpperBound(T v)
  {
    return SB_BinarySearchTree<T>.UpperBound(_root, v);
  }

  public Tuple<int, int> EqualRange(T v)
  {
    if (!Contains(v)) return new Tuple<int, int>(-1, -1);
    return new Tuple<int, int>(SB_BinarySearchTree<T>.LowerBound(_root, v), SB_BinarySearchTree<T>.UpperBound(_root, v) - 1);
  }

  public List<T> ToList()
  {
    return new List<T>(SB_BinarySearchTree<T>.Enumerate(_root));
  }
}

/// <summary>
/// C-like multiset
/// </summary>
public class MultiSet<T> : Set<T> where T : IComparable
{
  public override void Insert(T v)
  {
    if (_root == null) _root = new SB_BinarySearchTree<T>.Node(v);
    else _root = SB_BinarySearchTree<T>.Insert(_root, v);
  }
}

Compiler output:
a.cc:1:7: error: expected nested-name-specifier before 'System'
    1 | using System;
      |       ^~~~~~
a.cc:2:7: error: expected nested-name-specifier before 'System'
    2 | using System.Collections.Generic;
      |       ^~~~~~
a.cc:3:7: error: expected nested-name-specifier before 'System'
    3 | using System.Globalization;
      |       ^~~~~~
a.cc:4:7: error: expected nested-name-specifier before 'System'
    4 | using System.IO;
      |       ^~~~~~
a.cc:5:7: error: expected nested-name-specifier before 'System'
    5 | using System.Linq;
      |       ^~~~~~
a.cc:6:7: error: expected nested-name-specifier before 'System'
    6 | using System.Text;
      |       ^~~~~~
a.cc:7:7: error: expected nested-name-specifier before 'System'
    7 | using System.Threading.Tasks;
      |       ^~~~~~
a.cc:11:10: error: 'Printer' does not name a type
   11 |   static Printer sw = new Printer(Console.OpenStandardOutput()) { AutoFlush = false };
      |          ^~~~~~~
a.cc:26:2: error: expected ';' after class definition
   26 | }
      |  ^
      |  ;
a.cc: In static member function 'static void hawawa::Main()':
a.cc:15:5: error: 'Console' was not declared in this scope
   15 |     Console.SetOut(sw);
      |     ^~~~~~~
a.cc:15:20: error: 'sw' was not declared in this scope
   15 |     Console.SetOut(sw);
      |                    ^~
a.cc: In static member function 'static void hawawa::solve()':
a.cc:22:5: error: 'Scanner' was not declared in this scope
   22 |     Scanner scanner = new Scanner();
      |     ^~~~~~~
a.cc:23:13: error: 'scanner' was not declared in this scope
   23 |     int a = scanner.nextInt(), b = scanner.nextInt(), h = scanner.nextInt();
      |             ^~~~~~~
a.cc:24:5: error: 'Console' was not declared in this scope
   24 |     Console.WriteLine((a + b) * h / 2);
      |     ^~~~~~~
a.cc:24:28: error: 'b' was not declared in this scope
   24 |     Console.WriteLine((a + b) * h / 2);
      |                            ^
a.cc:24:33: error: 'h' was not declared in this scope
   24 |     Console.WriteLine((a + b) * h / 2);
      |                                 ^
a.cc: At global scope:
a.cc:30:3: error: 'string' does not name a type
   30 |   string[] s;
      |   ^~~~~~
a.cc:34:7: error: expected unqualified-id before '[' token
   34 |   char[] cs = new char[] { ' ' };
      |       ^
a.cc:36:9: error: expected ':' before 'Scanner'
   36 |   public Scanner()
      |         ^~~~~~~~
      |         :
a.cc:42:9: error: expected ':' before 'string'
   42 |   public string next()
      |         ^~~~~~~
      |         :
a.cc:42:10: error: 'string' does not name a type
   42 |   public string next()
      |          ^~~~~~
a.cc:52:9: error: expected ':' before 'int'
   52 |   public int nextInt()
      |         ^~~~
      |         :
a.cc:57:9: error: expected ':' before 'long'
   57 |   public long nextLong()
      |         ^~~~~
      |         :
a.cc:62:9: error: expected ':' before 'double'
   62 |   public double nextDouble()
      |         ^~~~~~~
      |         :
a.cc:67:2: error: expected ';' after class definition
   67 | }
      |  ^
      |  ;
a.cc: In constructor 'Scanner::Scanner()':
a.cc:38:5: error: 's' was not declared in this scope
   38 |     s = new string[0];
      |     ^
a.cc:38:13: error: 'string' does not name a type
   38 |     s = new string[0];
      |             ^~~~~~
a.cc: In member function 'int Scanner::nextInt()':
a.cc:54:12: error: expected primary-expression before 'int'
   54 |     return int.Parse(next());
      |            ^~~
a.cc:54:12: error: expected ';' before 'int'
a.cc:54:15: error: expected unqualified-id before '.' token
   54 |     return int.Parse(next());
      |               ^
a.cc: In member function 'long int Scanner::nextLong()':
a.cc:59:12: error: expected primary-expression before 'long'
   59 |     return long.Parse(next());
      |            ^~~~
a.cc:59:12: error: expected ';' before 'long'
a.cc:59:16: error: expected unqualified-id before '.' token
   59 |     return long.Parse(next());
      |                ^
a.cc: In member function 'double Scanner::nextDouble()':
a.cc:64:12: error: expected primary-expression before 'double'
   64 |     return double.Parse(next());
      |            ^~~~~~
a.cc:64:12: error: expected ';' before 'double'
a.cc:64:18: error: expected unqualified-id before '.' token
   64 |     return double.Parse(next());
      |                  ^
a.cc: At global scope:
a.cc:70:1: error: expected class-name before '{' token
   70 | {
      | ^
a.cc:71:9: error: expected ':' before 'override'
   71 |   public override IFormatProvider FormatProvider { get { return CultureInfo.InvariantCulture; } }
      |         ^~~~~~~~~
      |         :
a.cc:71:10: error: 'override' does not name a type
   71 |   public override IFormatProvider FormatProvider { get { return CultureInfo.InvariantCulture; } }
      |          ^~~~~~~~
a.cc:72:9: error: expected ':' before 'Printer'
   72 |   public Printer(Stream stream) : base(stream, new UTF8Encoding(false, true)) { }
      |         ^~~~~~~~
      |         :
a.cc:72:24: error: expected ')' before 'stream'
   72 |   public Printer(Stream stream) : base(stream, new UTF8Encoding(false, true)) { }
      |                 ~      ^~~~~~~
      |                        )
a.cc:73:9: error: expected ':' before 'Printer'
   73 |   public Printer(Stream stream, Encoding encoding) : base(stream, encoding) { }
      |         ^~~~~~~~
      |         :
a.cc:73:24: error: expected ')' before 'stream'
   73 |   public Printer(Stream stream, Encoding encoding) : base(stream, encoding) { }
      |                 ~      ^~~~~~~
      |                        )
a.cc:74:2: error: expected ';' after class definition
   74 | }
      |  ^
      |  ;
a.cc:80:1: error: expected unqualified-id before 'public'
   80 | public class SB_BinarySearchTree<T> where T : IComparable
      | ^~~~~~
a.cc:282:1: error: expected unqualified-id before 'public'
  282 | public class Set<T> where T : IComparable
      | ^~~~~~
a.cc:355:1: error: expected unqualified-id before 'public'
  355 | public class MultiSet<T> : Set<T> where T : IComparable
      | ^~~~~~