HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Contests > CEN112 Homeworks 2013-2015 > problem:


50530 - Sum of Ratios

CEN112 Homeworks 2013-2015

Start: Dec.15.2013 at 12:00:00 PM
Finish: Dec.15.2013 at 05:00:00 PM
The contest is finished!
• Contest scoreboard

Guest
• Review clarifications (2)

Contest problems

• 50530 - Sum of Ratios
• 50375 - Area of Circles
• 50388 - Number of Armstrong Num...
• 50393 - Palindromic Numbers
• 50339 - The Largest Rectangle
• 50345 - Orders
• 50758 - National Elections - Revisited
• 50754 - Team Standings
• 12-Spr1-40. 50327 - Parallel Lines

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.

Sum of Ratios

Question: Write a program (using Ratio class) that calculates the sum of n ratios and shows the result.

Input specification
You will be given an integer (n) the number of ratios. Then, in each of the following n lines you will be given two integers: numerator, and denominator of ratio where 1 ≤ n ≤ 100, 1 ≤ numerator ≤ 20 and 1 ≤ denominator ≤ 10.

Output specification
Show sum of the given ratios with two integers: numerator and denominator.

Sample Input
3
4 8
2 3
3 4
Sample Output
23 12

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

www.contester.ru