Back
Close

Simultaneous Ages

Statement

 Goal

Y years ago, Person A was M times older than Person B. Currently, Person A is older than Person B by N years. What are their ages now?
Input
Line 1: 3 integers: N M Y
Output
Line 1: A B, Person A and B's age respectively.
Constraints
0 < B < A < 100,000
0 < N, M, Y < 100,000
Example
Input
8 3 4
Output
16 8

Game modes
Fastest, Shortest

Test cases
Test 1 Test
Input
8 3 4
Output
16 8

Validator 1 Validator
Input
15 6 1
Output
19 4

Test 2 Test
Input
60 7 15
Output
85 25

Validator 2 Validator
Input
18 10 7
Output
27 9

Test 3 Test
Input
4 2 6
Output
14 10

Validator 3 Validator
Input
38 20 5
Output
45 7

Test 4 Test
Input
2475 100 1000
Output
3500 1025

Validator 4 Validator
Input
10 11 8
Output
19 9

Test 5 Test
Input
34368 1433 10150
Output
44542 10174

Validator 5 Validator
Input
41258 8 5894
Output
53046 11788

Solution language

Solution

Stub generator input