#include <stdio.h> /* IQ 80 */ int foo(int N) { int a, res = 0; for (int c = 1; c < N / 3 + 1; c++) { for (int b = c + 1; b < (N - c) / 2 + 1; b++) { a = N - (b + c); if (a > b) res += 1; } } return res; } /* IQ 90 */ int bar(int N) { int a, res = 0; for (int c = 1; c < N / 3 + 1; c++) { int rem = N - c; if (rem <= 2 * c + 1) continue; if (rem % 2 == 0) res += rem / 2 - 1 - c; else res += rem / 2 - c; } return res; } int main() { int i; for (i = 1; i < 2000; i++) { if (foo(i) != bar(i)) printf("%d, %d, %d\n", i, foo(i), bar(i)); } }

틀렸을 수도 있음ㅋ