{"size": 768, "ext": "js", "max_stars_repo_path": "Simple Fun #105: Rectangles.js", "max_stars_repo_name": "Dnmrk4/codewars-7kyu-part2", "max_stars_repo_stars_event_min_datetime": "2019-07-19T06:16:48.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-29T06:39:45.000Z", "max_issues_repo_path": "Simple Fun #105: Rectangles.js", "max_issues_repo_name": "Dnmrk4/codewars-7kyu-part2", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "Simple Fun #105: Rectangles.js", "max_forks_repo_name": "Dnmrk4/codewars-7kyu-part2", "max_forks_repo_forks_event_min_datetime": "2019-08-13T12:46:56.000Z", "max_forks_repo_forks_event_max_datetime": "2022-02-15T23:51:03.000Z"}
{"max_stars_count": 40, "max_issues_count": null, "max_forks_count": 17, "avg_line_length": 17.8604651163, "max_line_length": 114, "alphanum_fraction": 0.703125}
/*
Description:
Task
Imagine n horizontal lines and m vertical lines.

Some of these lines intersect, creating rectangles.

How many rectangles are there?

Examples
For n=2, m=2, the result should be 1.

there is only one 1x1 rectangle.

For n=2, m=3, the result should be 3.

there are two 1x1 rectangles and one 1x2 rectangle. So 2 + 1 = 3.

For n=3, m=3, the result should be 9.

there are four 1x1 rectangles, two 1x2 rectangles, two 2x1 rectangles and one 2x2 rectangle. So 4 + 2 + 2 + 1 = 9.

Input & Output
[input] integer n

Number of horizontal lines.

Constraints: 0 <= n <= 100

[input] integer m

Number of vertical lines.

Constraints: 0 <= m <= 100

[output] an integer

Number of rectangles.
*/
function rectangles(n, m) {
  return (n-1)*(m-1)*n*m/4;
}
