B - How many? Editorial /

Time Limit: 2 sec / Memory Limit: 1024 MB

配点 : 200

問題文

a+b+c \leq S かつ a \times b \times c \leq T を満たす非負整数の組 (a,b,c) はいくつありますか?

制約

  • 0 \leq S \leq 100
  • 0 \leq T \leq 10000
  • S, T は整数である。

入力

入力は以下の形式で標準入力から与えられる。

S T

出力

条件を満たす非負整数の組 (a,b,c) の個数を出力せよ。


入力例 1

1 0

出力例 1

4

条件を満たす非負整数の組 (a,b,c)(0,0,0), (0,0,1), (0,1,0), (1,0,0)4 つです。


入力例 2

2 5

出力例 2

10

入力例 3

10 10

出力例 3

213

入力例 4

30 100

出力例 4

2471

Score : 200 points

Problem Statement

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

Constraints

  • 0 \leq S \leq 100
  • 0 \leq T \leq 10000
  • S and T are integers.

Input

Input is given from Standard Input in the following format:

S T

Output

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


Sample Input 1

1 0

Sample Output 1

4

The triples (a,b,c) satisfying the conditions are (0,0,0), (0,0,1), (0,1,0), and (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