Poster mailing
InterviewTime limit1sMemory limit1024 MB
Given three paper basis weights, compute the total weight in grams of an envelope, two posters, and an info sheet from their dimensions.
- Level
Easy2 of 10
- Topics
- Math, Implementation, Geometry
- Solved
- No attempts yet
Problem
VE OCH FASA! For the th year in a row, PostNord has raised the postage, and the budget of the Programming Olympiad (Programmeringsolympiaden, PO) is at risk of breaking.
Every year PO sends posters to about upper secondary schools. One mailing consists of three things:
- an envelope of C4 size ()
- two posters of A3 size ()
- one information sheet of A4 size ()
The letter must weigh at most grams, since otherwise the postage is twice as high. To meet this magic weight limit, PO can choose which kind of paper is used for the three things. Each kind has a basis weight (weight per area), usually given in . Note that the envelope is made of two sheets glued together of C4 size, while the basis weights and the dimensions above apply to one sheet.
Write a program that computes the total weight of one letter.
Input
The input consists of three integers between and , the basis weights in of the kinds used for the envelope, the posters, and the information sheet, respectively.
Output
Print a single real number: the weight of one complete mailing in grams. The answer must be given with an accuracy of at least decimals, that is, within of the correct answer.