Problems
Fractions: n-th term of the sequence
Fractions: n-th term of the sequence
Arithmetic progression is given with the first term a / b and difference p / q. Find the n-th term of the sequence.
Input
Two fractions a / b, p / q and number n. All numbers are positive integers no more than 106
.
Output
Print the n-th term of arithmetic progression in the form of irreducible fraction.
Input example #1
2/3 3/5 3
Output example #1
28/15
Input example #2
1/3 2/3 32
Output example #2
21/1
Input example #3
4/5 2/3 56
Output example #3
562/15