Problem:
Score : 100 points

Problem Statement

There are H rows and W columns of white square cells.

You will choose h of the rows and w of the columns, and paint all of the cells contained in those rows or columns.

How many white cells will remain?

It can be proved that this count does not depend on what rows and columns are chosen.

Constraints

All values in input are integers.

1 \leq H, W \leq 20

1 \leq h \leq H

1 \leq w \leq W

Input

Input is given from Standard Input in the following format:

H W
h w

Output

Print the number of white cells that will remain.

Sample Input 1

3 2
2 1

Sample Output 1

1

There are 3 rows and 2 columns of cells. When two rows and one column are chosen and painted in black, there is always one white cell that remains.

Sample Input 2

5 5
2 3

Sample Output 2

6

Sample Input 3

2 4
2 4

Sample Output 3

0

Solution in C# (Mono 4.6.2.0) (judge verdict: Accepted)

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using static A.MyUtil;

namespace A
{
	internal class Program
	{
		public static void Main(string[] args)
		{
			int H, W, h, w;
			Input(out H, out W);
			Input(out h, out w);

			Print((H - h) * (W - w));
			sw.Flush();
		}
	}

	public static class MyUtil
	{
		/**************************************************
		 * 入力
		 **************************************************/

		public static string InString => Console.ReadLine().Trim();
		public static int InInt => int.Parse(InString);
		public static long InLong => long.Parse(InString);
		public static double InDouble => double.Parse(InString);
		public static char InChar => char.Parse(InString);

		public static IEnumerable<string> InStrings =>
			InString.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);

		public static IEnumerable<int> InInts => InStrings.Select(int.Parse);
		public static IEnumerable<long> InLongs => InStrings.Select(long.Parse);
		public static IEnumerable<double> InDoubles => InStrings.Select(double.Parse);
		public static IEnumerable<char> InChars => InStrings.Select(char.Parse);

		public static string[] InStringArray => InStrings.ToArray();
		public static int[] InIntArray => InInts.ToArray();
		public static long[] InLongArray => InLongs.ToArray();
		public static double[] InDoubleArray => InDoubles.ToArray();
		public static char[] InCharArray => InChars.ToArray();

		public static List<string> InStringList => InStrings.ToList();
		public static List<int> InIntList => InInts.ToList();
		public static List<long> InLongList => InLongs.ToList();
		public static List<double> InDoubleList => InDoubles.ToList();
		public static List<char> InCharList => InChars.ToList();

		public static void Input<T>(out T variable) { variable = ChangeValue<T>(InString); }

		public static void Input<T1, T2>(out T1 variable1, out T2 variable2)
		{
			var ary = InStringArray;
			variable1 = ChangeValue<T1>(ary[0]);
			variable2 = ChangeValue<T2>(ary[1]);
		}

		public static void Input<T1, T2, T3>(out T1 variable1, out T2 variable2, out T3 variable3)
		{
			var ary = InStringArray;
			variable1 = ChangeValue<T1>(ary[0]);
			variable2 = ChangeValue<T2>(ary[1]);
			variable3 = ChangeValue<T3>(ary[2]);
		}

		public static void Input<T1, T2, T3, T4>(out T1 variable1, out T2 variable2, out T3 variable3, out T4 variable4)
		{
			var ary = InStringArray;
			variable1 = ChangeValue<T1>(ary[0]);
			variable2 = ChangeValue<T2>(ary[1]);
			variable3 = ChangeValue<T3>(ary[2]);
			variable4 = ChangeValue<T4>(ary[3]);
		}

		public static void Input<T1, T2, T3, T4, T5>(out T1 variable1,
		                                             out T2 variable2,
		                                             out T3 variable3,
		                                             out T4 variable4,
		                                             out T5 variable5)
		{
			var ary = InStringArray;
			variable1 = ChangeValue<T1>(ary[0]);
			variable2 = ChangeValue<T2>(ary[1]);
			variable3 = ChangeValue<T3>(ary[2]);
			variable4 = ChangeValue<T4>(ary[3]);
			variable5 = ChangeValue<T5>(ary[4]);
		}

		public static void Input<T1, T2, T3, T4, T5, T6>(out T1 variable1,
		                                                 out T2 variable2,
		                                                 out T3 variable3,
		                                                 out T4 variable4,
		                                                 out T5 variable5,
		                                                 out T6 variable6)
		{
			var ary = InStringArray;
			variable1 = ChangeValue<T1>(ary[0]);
			variable2 = ChangeValue<T2>(ary[1]);
			variable3 = ChangeValue<T3>(ary[2]);
			variable4 = ChangeValue<T4>(ary[3]);
			variable5 = ChangeValue<T5>(ary[4]);
			variable6 = ChangeValue<T6>(ary[5]);
		}

		/**************************************************
		 * 出力
		 **************************************************/

		public static StreamWriter sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };

		public static void Print(string output) { sw.WriteLine(output); }

		public static void Print<T>(IEnumerable<T> outputs) { Print(string.Join(" ", outputs)); }

		public static void Print(params object[] outputs) { Print(string.Join(" ", outputs)); }


		/**************************************************
		 * 中間メソッド
		 **************************************************/

		private static bool IsEqualType<T1, T2>() { return typeof(T1) == typeof(T2); }

		private static T1 ChangeType<T1, T2>(T2 src) { return (T1) Convert.ChangeType(src, typeof(T1)); }

		private static T ChangeValue<T>(string s)
		{
			if (IsEqualType<T, int>()) { return ChangeType<T, int>(int.Parse(s)); }

			if (IsEqualType<T, long>()) { return ChangeType<T, long>(long.Parse(s)); }

			if (IsEqualType<T, double>()) { return ChangeType<T, double>(double.Parse(s)); }

			if (IsEqualType<T, char>()) { return ChangeType<T, char>(char.Parse(s)); }

			return ChangeType<T, string>(s);
		}
	}
}