using System;
using System.Collections.Generic;
using System.Text;
namespace Task
{
class Program
{
static void Main(string[] args)
{
string[] s = Console.ReadLine().Split(' ');
int n = int.Parse(s[0]);
int a = int.Parse(s[1]);
int b = int.Parse(s[2]);
int c = int.Parse(s[3]);
int v = 0;
int max2 = n / 2;
int min2 =(int)Math.Ceiling(((double)n - (double)b-0.5*a) / 2);
if((a*0.5+b+c*2)>=n)
for (int i = 0; i <= a; i+=2)
for (int j = 0; j <= b; j++)
for (int h =min2; h <= max2; h++)
if (n == (0.5 * i + j + 2 * h))
v++;
Console.WriteLine(v);
}
}
}Add a code snippet to your website: www.paste.org