问题2955--Elite Eating

2955: Elite Eating

[命题人 : ]
时间限制 : 1.000 sec  内存限制 : 64 MB

题目描述

Farmer John's 100 cows are conveniently branded with the integers 1..100. FJ has created an elite milking program where exactly N (1 <= N <= 25) cows with certain brands get to enter the barn first. The restriction on this elite group of cows is that the sum of the squares of the brands of each member of the group must be strictly less than a given integer S (1 <= S <= 10,000). Determine the number of different groups of cows that can be selected for the elite milking program.

输入

* Line 1: Two space-separated integers: N and S

输出

* Line 1: A single integer that is the number of different possible groups that can line up for elite eating.

样例输入 Copy

3 30

样例输出 Copy

4

提示

OUTPUT DETAILS: The sequences of length 3 with sum of squares < 30 are: 1 2 3 1 2 4 2 3 4 1 3 4 The sequence of brands 1 2 5 is not valid since 1 + 4 + 25 = 30 and is not strictly less than 30.

来源/分类