RAHUL'S SHOPPING

3.3

26 votes
Problem

Rahul has to buy a few wooden planks ,the shop he visited has 50 different types of wooden planks available.Each type of plank is marked from 1-50.The rate(per square feet) of each plank is calculated as the number marked on the plank multiplied by sum of the digits of the number marked on the plank.He told the shopkeeper that he needed n number of planks of same dimensions and specified the number on each plank.And also told the size of plank he needed(length & breath(in feet)).Now calculate the total amount he has to pay to the shopkeeper. Also their is Discount available on each type of plank, plank numbered from 1-10 having 25% discount,11-20 having 30% discount ,20-50 having 20% discount.(if the cost of each plank after discount is in decimals e.g. 23.30 then it is rounded off to nearest integer it means 23)

Input: First line tells the no. of planks n to brought. second line specifies the different planks to be brought. third line represents the size of plank (length and breath).

Output: total amount to be paid

Constraints: 1<=n<=50

1<=length,breath<=10

Time Limit: 5
Memory Limit: 256
Source Limit:
Explanation

In first line 3 is entered as no. of planks to be brought. In second line 12 , 5, 42 are the plank's to be brought & the Third line represents the size of planks 2, 3 (length,breath).

output is the amount to be paid.

Editor Image

?