jhy 2024-01-27 19:27:13
#include using namespace std; int main(){ int a,b,c,s,k,cnt = 0; cin >> k >> s; for(int i = 0;i <= k;i++){ for(int j = 0;j <= k;j++){ a = i; b = j; c = s - i - j; if(c >= 0 && c <= k && a + b + c == s ){ cnt++; } }
} cout << cnt; return 0; }