Programming contests

ICPC programozó csapatverseny, házi forduló, 2019. október 30.

October 30, 2019, 10:00 AM – October 30, 2019, 3:00 PM

Triples

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

Tm, j = {(x, y, z) ∈ ℕ3x ≤ y ≤ z ≤ m and xj + yj = zj},   j = 2, …, n,

where ℕ is the set of nonnegative integers (ℕ = {0, 1, 2, …}).

The problem asks you to compute the sum Sm,n:

where card(Tm, j) is the number of elements of the set Tm, j.

Input Specification

The input contains a single test case. The first line of the input contains the value of m, and the second line contains the value of n.

Output Specification

Output a single line with the value of the sum Sm,n.

Sample Input

  1. 85
  2. 95
download as text file

Output for Sample Input

  1. 8128
download as text file

Original Problem

Southeastern Europe Regional Contest, 2014

University of Debrecen; Faculty of Informatics; v. 09/30/2024