A - K-City Editorial /

Time Limit: 2 sec / Memory Limit: 256 MB

配点 : 100100

問題文

K 市には、東西方向に nn 本の通りがあり、南北方向に mm 本の通りがあります。 東西方向のそれぞれの通りは、南北方向のそれぞれの通りと交わっています。 東西南北を通りに囲まれた最小の領域を「街区」と呼びます。 K 市にある街区の個数を求めてください。

制約

  • 2n,m1002 ≤ n, m ≤ 100

入力

入力は以下の形式で標準入力から与えられる。

nn mm

出力

K 市にある街区の個数を出力せよ。


入力例 1Copy

Copy
3 4

出力例 1Copy

Copy
6

次図の 66 個です。

9179be829dc9810539213537d4c7398c.png

入力例 2Copy

Copy
2 2

出力例 2Copy

Copy
1

次図の 11 個です。

997bfafa99be630b54d037225a5c68ea.png

Score : 100100 points

Problem Statement

In K-city, there are nn streets running east-west, and mm streets running north-south. Each street running east-west and each street running north-south cross each other. We will call the smallest area that is surrounded by four streets a block. How many blocks there are in K-city?

Constraints

  • 2n,m1002 ≤ n, m ≤ 100

Input

Input is given from Standard Input in the following format:

nn mm

Output

Print the number of blocks in K-city.


Sample Input 1Copy

Copy
3 4

Sample Output 1Copy

Copy
6

There are six blocks, as shown below:

9179be829dc9810539213537d4c7398c.png

Sample Input 2Copy

Copy
2 2

Sample Output 2Copy

Copy
1

There are one block, as shown below:

997bfafa99be630b54d037225a5c68ea.png


2025-04-23 (Wed)
06:10:06 +00:00