import java.util.*;
import java.lang.*;
import java.io.*;
record MyPair(int total, long free) {}
// The main method must be in a class named "Main".
class Main {
private static long SolveMe(int total, int free, Map<MyPair, Long> known) {
if (total == 0 || free <= 1)
return 1;
MyPair pair = new MyPair(total, free);
if (known.containsKey(pair))
return known.get(pair);
long result = 0;
for (int i = 0; i <= total; ++i)
result += SolveMe(i, free - 1, known);
known.put(pair, result);
return result;
}
private static long SolveMe(int total, int free) {
return SolveMe(total, free, new HashMap<MyPair, Long>());
}
public static void main(String[] args) {
long result = SolveMe(213, 6);
System.out.println(result);
}
}
To embed this program on your website, copy the following code and paste it into your website's HTML: