HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Object Oriented Programming > problem:


50530 - Sum of Ratios

Guest
• Review clarifications (2)

Volume problems

• 50530 - Sum of Ratios
• 50345 - Orders
• 50346 - The Biggest Date
• 50992 - Top K Obese Classes
• 50991 - Intersecting Circles
• 50989 - Rectangles and Points
• 50984 - Top m hardworking employees
• 50269 - Matrix Determinant
• 50986 - The Oldest Person

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