Computer Science, asked by jayanthamma198, 1 month ago

Given an integer N denoting the Length of a line segment, you need to cut the line segment in such a way that the cut length of a line segment each time is integer either x, y or z. and after performing all cutting operation the total number of cutted segments must be maximum.

Input: First line of input contains of an integer 'T' denoting number of test cases. First line of each testcase contains N. Second line of each testcase contains 3 space separated integers x, y and z.

Output: For each test case print in a new line an integer corresponding to the answer .

Constraints: 1<=t<=70
1<=N,x,y,z<=4000​

Answers

Answered by Anonymous
0

Answer:

Explanation:

The donating length of the corresponding segment to cut the line at :

T=z,x,y.

Similar questions