#P2241. 统计方形(数据加强版)

统计方形(数据加强版)

Description

Given an n×mn \times m grid board, compute how many squares and how many rectangles (excluding squares) it contains.

Input Format

One line: two positive integers n,mn,m (n5000,m5000n \leq 5000,m \leq 5000).

Output Format

One line: two positive integers, the numbers of squares and rectangles (excluding squares) in the grid, respectively.

2 3
8 10

Hint

Translated by ChatGPT 5