[BOJ 10357] Triples

View as PDF

Submit solution

Points: 2
Time limit: 5.0s
Memory limit: 256M

Problem types
Allowed languages
Assembly, Awk, C, C++, Java, Pascal, Perl, Python, Sed, Text

Mr. A invites you to solve the following problem:</p>

“Let be (m) and (n) two positive integers, (5 \le m \le 100), (2 \le n \le 100). Consider the following sets of triples:

[T_{m,j} = \left{ { (x,y,z) \in \mathbb{N}^{3} }|{ x \le y \le z \le m \( and \) x^j + y^j = z^j } \right} ,  j = 2 .. n]

where (\mathbb{N}) is the set of nonnegative integers ((\mathbb{N}) = {0, 1, 2, ...}).

The problem asks you to compute the sum (S_{m,n}):

[S_{m,n} = \sum_{j=2}^{n}{card(T_{m,j})}]

where (card(T_{m,j})) is the number of elements of the set (T_{m,j})."

입력 형식

The input file contains a single test. The first line of the input file contains the value of (m)and the second line contains the value of (n).</p>

 

출력 형식

The result will be written to standard output.

예제 입력

85
95

예제 출력

8128

Comments

There are no comments at the moment.