Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started