← Back to List

14568번: 2017 연세대학교 프로그래밍 경시대회 ↗

Solutions

C++14
229 B | 229 chars
#include <iostream>
using namespace std;
int N,Cnt;
int main()
{
	cin>>N;
	for(int x=1; x<=N; x++)
	{
		for(int y=1; y<=N; y++)
		{
			for(int z=1; z<=N; z++)
			{
				if(x+y+z==N&&x%2==0&&z-y>=2) Cnt++;
			}
		}
	}
	cout<<Cnt;
}