Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 3 Given x no . of houses in a city. You have to divide these houses into Y no . of localities such that

Question 3
Given x no. of houses in a city. You have to divide these houses into Y no. of localities such that every locality has at least one
house. Also, every house in a locality should have a telephone connection wire with each of the other houses in the same locality.
No need to connect any house with the houses outside its own locality.
You are given integers X and Y. X: Represents the number of houses Y: Represents the number of localities
Write a function that takes x&Y as arguments & prints the minimum and the maximum number of telephone connections
required to design the city accordingly.
Example:
Ex-1:
Input =x:5,Y:3, Output = Min: 2, Max: 3
Ex-2:
Input =x:10,Y:2, Output = Min: 20, Max: 36
N.B.: The code must be proficient enough to handle inputs of numbers up to 1.7976931348623157e+308
image text in transcribed

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

Step: 3

blur-text-image

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

Fundamentals Of Database Systems

Authors: Ramez Elmasri, Sham Navathe

4th Edition

0321122267, 978-0321122261

More Books

Students also viewed these Databases questions

Question

Were they made on a timely basis?

Answered: 1 week ago