Home > Back-end >  Turn a problem
Turn a problem

Time:11-19

Triangle
Chinese

Subject limit
1000 ms 128 M

Title description
Now the factory has three iron bar, long respectively to a, b, c, now you can be extended to some of the iron bar, but the total extension length can't more than L, asked how many kinds of extended scheme can make the iron bar after extended triangle,

Input format
A total of a line, contains 4 integers a, b, c, L (1 or less a, b, c or less 3 e5, 0 or less L 3 e5) or less,

The output format
A line of an integer said the answer

Data range
About 30% of the data: a, b, c or less 100
For the other 20% of data: L 10 or less
About 100% of the data: 1 or less a, b, c or less 3 e5, 0 or less L 3 or less e5
The input sample
Input the sample 1:
1 1 1 2
Enter the sample 2:
1 2 3 1
Enter the sample 3:
10 2 1 7
The output sample
The output sample 1:
4
The output sample 2:
2
The output sample 3:
0
The sample explain
Four kinds of solutions for:

(1) for a longer 1, for extended 1 b

(2) to a longer one, give a c extension 1

(3) to extension 1 b to c extended 1

(4) no longer

CodePudding user response:

There is something wrong with it, the brain, such a simple question...
  • Related