Cattleways Solutions Pvt. LTD.: Attempt The Two Problems
Cattleways Solutions Pvt. LTD.: Attempt The Two Problems
Instructions
Use Codechef Online IDE - https://www.codechef.com/ide or you can choose your own from that
you can download the code.
Lets code!
Problem 1
Fill Circles
The below images are just for representation. Your output may look different. Even a program
which does not draw the objects but calculates the co-ordinates is acceptable.
Cattleways Solutions Pvt. Ltd.
Problem 2
Map Values
Write an program that reads a list of numbers input_list (from a file or any other source such as a
html textarea). Now given two values (P,Q) it maps the input_list to another output_list using (P,
Q), both inclusive, as the range.
In other words, P maps to the lowest number in the input_list and Q maps to the highest number
in the input_list and all other values in between, from the input_list is scaled up or down linearly.
Eg for P = 1 and Q = 5.
input_list : 1, 2, 3, 4, 5
maps to output_list : 1,
2, 3, 4, 5