P26414 [AtCoder] Square Chips
普及
题目描述

Problem Description

We will perform a process called dicing on a wafer with a radius of $ R $ cm to create several square chips. Determine the number of square chips that can be created.

A wafer is a thin, circular disk used to make certain components. The dicing process involves cutting the wafer at intervals of $ C $ cm from the center of the wafer in both horizontal and vertical directions to divide the wafer.

As an example, for $ R=15 $ and $ C=4 $, the wafer is divided into a grid pattern as shown by the dashed lines, and 32 square chips can be created as indicated by the green regions.

3b83484e97d59df50e3ee39c4a3cbca7.png

Input Format

The input is given from the standard input in the following format:

$ R $ $ C $

Output Format

Output the number of square chips created in one line.

Sample Input and Output

Sample Input #1

15 4

Sample Output #1

32

Sample Input #2

5 1

Sample Output #2

60

Notes/Hints

Constraints

  • $1 \leq R, C \leq 100$
  • Both $ R $ and $ C $ are integers.

Sample Explanation 1

  • As described in the problem statement.

Sample Explanation 2

  • When the center of the wafer is at $ (0,0) $, the square chip represented by the points $ (2,3), (3,3), (2,4), (3,4) $ has one point $ (3,4) $ on the edge of the wafer, but such chips can also be created.
输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
15 4
样例输出
32