mit-indiv09-coaches
While you are solving the problems, the coaches (Aleks and Andy) are playing an interesting game. First they agree on an interval [a, b] (1 <= a <= b <= 1000). Then the computer generates two integers x and y (x <= y) from that interval, and reports the product to Aleks, and the sum to Andy. After that they both try to guess the numbers.
You overheard the conversation of the two coaches:Aleks: I don’t know the numbers
Andy: I don’t know the numbers
Aleks: I don’t know the numbers
Andy: I don’t know the numbers
Aleks: I don’t know the numbers
Andy: I don’t know the numbers
Aleks: ...
Andy: ... (N times)
Aleks: I know the numbers.
For given N you have to find out what the numbers x and y are.
InputThe first line of the input contains three space separated integers a, b and N. N is the number of times that both Aleks and Andy said “I don’t know the numbers” before Aleks finally said “I know the numbers”.
OutputIn the first line of the output write two space separated integers representing the numbers x and y. If x and y can’t be uniquely determined write “0 0” - two space separated zeros.
Input:
1 9 1Output:
1 4Submit solution
Sign in to submit a solution.