Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|

Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |

Language: Cocktail
Description Cylindrical vessel of height D are densities of the first and the second liquids respectively, 0 < _{2}D < _{2}D ≤ 10000. _{1}h and _{1}h are heights of layers of the first and the second liquids, _{2}h, _{1}h > 0, _{2}h + _{1}h ≤ _{2}H. There is a cube made of a solid material. The cube’s edge length is n (0 < n ≤ 1.4*R), the material’s density is D (0 < D ≤ 10 000). The cube is put down into the vessel in such a way that one of its sides is horizontal. Pay attention that some amount of liquid may pour out of the vessel. As a result of the operation the cube floats in liquids or lie on the vessel bottom.You need to calculate the height of the vessel which is occupied by the liquids after the cube is put down into the vessel. You may neglect damping and some other physical effects, but you should take into account Archimedean Principle. Input The only line of the input contains numbers h, _{1}D, _{2}h, _{2}D and n separated by spaces. All the numbers are real. Each of them does not contain more than three digits in its fractional part.Output The output contains one real number – the height you need to calculate. Absolute error must not exceed Sample Input 50 5 2.5 10 1.5 10 1.5 3 Sample Output 20.344 Source Northeastern Europe 2005, Western Subregion |

[Submit] [Go Back] [Status] [Discuss]

All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di

Any problem, Please Contact Administrator