Question: You are given a positive integer N denoting the length of a wire and 3 integers X,Y and Z. Find the maximum number of segments


You are given a positive integer N denoting the length of a wire and 3 integers X,Y and Z. Find the maximum number of segments of lengths X,Y and Z that can be formed from N. Suppose N=7,X=5,Y=2 and Z=3, the maximum number of segments of lengths 2 , 3 and 5 that can be formed from N will be 3 (2+2+3) def calc_value (n,x,y,z) : \#write your code here n=int( input ()) xyz=[,,] xyz=input(). split ( ) for i in range (3): xyz[i]=int(xyz[i]) xyz.sort( ) x=xyz[] y=xyz[1] z=xyz[2] print (calc_value (n,x,y,z) )
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
