CF571A.Lengthening Sticks

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

You are given three sticks with positive integer lengths of a,ba,b , and cc centimeters. You can increase length of some of them by some positive integer number of centimeters (different sticks can be increased by a different length), but in total by at most ll centimeters. In particular, it is allowed not to increase the length of any stick.

Determine the number of ways to increase the lengths of some sticks so that you can form from them a non-degenerate (that is, having a positive area) triangle. Two ways are considered different, if the length of some stick is increased by different number of centimeters in them.

输入格式

The single line contains 44 integers a,b,c,la,b,c,l ( 1<=a,b,c<=31051<=a,b,c<=3·10^{5} , 0<=l<=31050<=l<=3·10^{5} ).

输出格式

Print a single integer — the number of ways to increase the sizes of the sticks by the total of at most ll centimeters, so that you can make a non-degenerate triangle from it.

输入输出样例

  • 输入#1

    1 1 1 2
    

    输出#1

    4
    
  • 输入#2

    1 2 3 1
    

    输出#2

    2
    
  • 输入#3

    10 2 1 7
    

    输出#3

    0
    

说明/提示

In the first sample test you can either not increase any stick or increase any two sticks by 11 centimeter.

In the second sample test you can increase either the first or the second stick by one centimeter. Note that the triangle made from the initial sticks is degenerate and thus, doesn't meet the conditions.

首页