int func1_c(const int n, const int m) {
int begin = n/3, end = m/3;
return 3 * (end + begin) * (end - begin + 1) /2;
}
これでも、あってますか?