問題一覧 > 通常問題

No.2043 Ohuton and Makura

レベル : / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 154
作問者 : 👑 箱星 / テスター : 👑 hitonanode 👑 Kazun
お気に入りにしたユーザー ProblemId : 8049 / 自分の提出
問題文最終更新日: 2022-08-09 22:12:11
Ohuton and Makura
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
yukicoder contest 357 (順位表) の他の問題:

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もしくは右上の雲マークをクリックしてアカウントを作成してください。