#abc214b. B - How many?

B - How many?

Score : 200200 points

问题陈述

有多少组非负整数三元组 (a,b,c)(a, b, c) 满足条件 a+b+cSa + b + c \leq Sa×b×cTa \times b \times c \leq T

以上为通义千问 qwen-max 翻译,仅供参考。

Problem Statement

How many triples of non-negative integers (a,b,c)(a, b, c) satisfy a+b+cSa+b+c \leq S and a×b×cTa \times b \times c \leq T?

Constraints

  • 0S1000 \leq S \leq 100
  • 0T100000 \leq T \leq 10000
  • SS and TT are integers.

Input

Input is given from Standard Input in the following format:

SS TT

Output

Print the number of triples of non-negative integers (a,b,c)(a,b,c) satisfying the conditions.

Sample Input 1

1 0

Sample Output 1

4

The triples (a,b,c)(a,b,c) satisfying the conditions are (0,0,0)(0,0,0), (0,0,1)(0,0,1), (0,1,0)(0,1,0), and (1,0,0)(1,0,0) ― there are four of them.

Sample Input 2

2 5

Sample Output 2

10

Sample Input 3

10 10

Sample Output 3

213

Sample Input 4

30 100

Sample Output 4

2471

update @ 2024/3/10 09:31:04