HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Contests > "Informatics Stars" Online Contests - 2011-2014 > problem:


2012-12-10. 50546 - Average Fuel Price

"Informatics Stars" Online Contests - 2011-2014

Start: Oct.20.2012 at 10:00:00 AM
Finish: Oct.20.2012 at 03:00:00 PM
The contest is finished!
• Contest scoreboard

Guest
• Review clarifications (1)

Contest problems

• 2012-02-8. 50596 - Your Ride Is He...
• 2012-03-01. 50563 - Long Modulus
• 2012-03-02. 50567 - Input Data No...
• 2012-03-04. 50597 - Drawing Diam...
• 2012-10-02. 50555 - Frequency of L...
• 2012-10-04. 50598 - Minimum Sum
• 2012-11-30. 50656 - Divisibility by 11
• 2012-11-40. 50558 - Biggest Barn
• 2012-12-10. 50546 - Average ...
• 2012-12-20. 50574 - Triangular Nu...
• 2012-12-30. 50684 - Sum of prime ...
• 2013-01-10. 50584 - Total invoice ...
• 2013-01-30. 50599 - Sum of Squar...
• 2013-03-20. 50578 - Mersenne prime
• 2013-03-30. 50360 - National Elections
• 2013-03-40. 50705 - Student Clubs
• 2014-04-10. 50547 - Close Pair

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb.
Prepared by Ibrahim Mesecan.

Average Fuel Price

Shqip

Mr. Alban Shehu has bought a new car and he is curious about its fuel consumption. He has recorded his initial and final mileages at the top and then he gives his daily payments and the liter price of fuel. After his last day, he has placed a negative number to show the end of list. He wants to calculate the amount of fuel consumed in every 100kms and the average price for that.

The fuel consumption can be calculated:
   (Fuel consumption per 100kms) = (Total liters consumed) / (Total km's made) * 100
   (Average liter price) = (Total amount paid) / (total liters bought)
   (Average price per 100kms) = (Average Liter Price) * (Fuel consumption per 100kms)

Input specification
You will be first given two integer numbers showing the initial and final mileages where 1 < initial mileage < final mileage ≤ 1000.000. Then each of the following lines contains two floating point numbers, the amount of money paid and the liter price of the fuel for that day. There are at most 10.000 fuel entries, and every number is less than 100. The fuel entry ends with a negative number.

Output specification
You will give two numbers (Fuel consumption per 100kms) and the (Average price per 100kms). When comparing your result with the expected result the program uses:
    if (abs(yourCalculatedResult - expectedResult)>0.001) return ERROR;
to decide if given result is correct or not. That is, if the difference between your result and the exprected result is less than 0.001, it's assumed to be correctly calculated.

Sample Input:
15000 15500
25.5 1.7
17 1.7
18 1.8
-1

Input Explanation:
15000 15500 ==> initial and final mileages
25.5 1.7 ==> On the first day he paid $25.5 and the liter price of the fuel was $1.7
...

Sample Output:
7.0 12.1


Для отправки решений необходимо выполнить вход.

www.contester.ru