Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Informix Database Administrators Survival Guide

Authors: Joe Lumbley

1st Edition

0131243144, 978-0131243149

More Books

Students also viewed these Databases questions

Question

please dont use chat gpt or other AI 4 8 5 .

Answered: 1 week ago

Question

understand the key issues concerning international assignments

Answered: 1 week ago