No.2043 Ohuton and Makura
タグ : / 解いたユーザー数 154
作問者 : 👑
hitonanode
👑
Kazun
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Show the original
Problem Statement
Koboshi has decided to prepare a mattress futon and a pillow on the coordinate plane and go to sleep.
The mattress futon is the rectangle $\{(x,y)\in\mathbb{R}^2\mid 0\le x\le A, 0\le y\le B\}$.
A pillow is a rectangle whose vertices are lattice points and whose sides are parallel to the $x$-axis or the $y$-axis.
How many pillows satisfy the following conditions?
- The area of the pillow is at least $1$ and at most $S$.
- The pillow is on the mattress futon (that is, the region represented by the pillow is a subset of the region represented by the mattress futon).
It can be proved that the answer is at most $9\times 10^{18}$ under the constraints of this problem.
Constraints
- $1\le A,B,S\le 5\times 10^5$
- All inputs are integers.
Input
$A$ $B$ $S$
Output
Output the answer.
Sample
Sample 1
Input
3 4 2
Output
29
Here is an example of a pillow satisfying the conditions. The blue rectangle represents the mattress futon, and the red rectangle represents the pillow.
Sample 2
Input
1 1 100
Output
1
Sample 3
Input
100000 200000 300000
Output
59141508890785287
The answer can be large.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。