Fractions sequence

4.6

7 votes
Operators, Algorithms, Basic Math, Math
Problem

M has a fraction ab that a<b, M is alone so he needs a sequence of fractions of length l that satisfy following conditions:

  • For each fraction pq in the sequence, p must be less than q (p<q).
  • The multiplication of fractions must be equal to ab (li=1piqi=ab).
  • 1p,q1018

Input

The only input line contains three integers a,b,l separated by space.

1a,b108

1l103

Output

The ouput should contains l lines that each line contains pi,qi separated by space, the fraction sequence which satisfy conditions, it there are multiple sequences print any of them.

Time Limit: 3
Memory Limit: 256
Source Limit:
Explanation

12×23=13

Editor Image

?