QOJ.ac

QOJ

Time Limit: 3 s Memory Limit: 1024 MB Total points: 100 Hackable ✓

#5359. 面国建设

Statistics

面皇开天辟地之后的很长一段时间内,面国都是一片荒芜。在某一天,面皇想要在面国里建造一些建筑。根据面皇的建筑美学,一个完美的建筑必须是二维平面上的边长为正整数的矩形,且任意两个不同的建筑不会有任何形式的相交。面皇可以建造任意多的任意形状的完美建筑。

然而面国虽然非常有面子,但是资源十分匮乏,所以面皇建造的矩形的面积之和不能超过 $S$,周长之和不能超过 $C$。

现在面皇想知道,有多少对 $(A,B)$ 满足:$1\leq A\leq S$,$1\leq B\leq C$,且存在一种建造的方案,使得建筑的面积之和为 $A$,周长之和为 $B$。

输入格式

第一行两个正整数 $S,C$

输出格式

输出一个非负整数,表示有多少对 $(A,B)$ 满足条件

样例数据

样例输入

4 10

样例输出

7

子任务

Task1 (6分):$1 \leq S , C \leq 10$

Task2 (12分):$1\leq S , C \leq 10^3$

Task3 (31分): $1\leq S , C \leq 6000$

Task4 (51分): $1\leq S \leq 2\times 10^5$,$1\leq C \leq 4 \times 10^5$

About Issues

We understand that our problem archive is not perfect. If you find any issues with the problem, including the statement, scoring configuration, time/memory limits, test cases, etc.

You may use this form to submit an issue regarding the problem. A problem moderator will review your issue and proceed it properly.

STOP! Before you submit an issue, please READ the following guidelines:

  1. This is not a place to publish a discussion, editorial, or requests to debug your code. Your issue will only be visible by you and problem moderators. Other users will not be able to view or reply your issues.
  2. Do not submit duplicated issues. If you have already submitted one, please wait for an moderator to review it. Submitting multiple issues will not speed up the review process and might cause your account to be banned.
  3. Issues must be filed in English or Chinese only.
  4. Be sure your issue is related to this problem. If you need to submit an issue regarding another problem, contest, category, etc., you should submit it to the corresponding page.

Active Issues 0

No issues in this category.

Closed/Resolved Issues 0

No issues in this category.