I have been trying this problem for some days.The problem is
My solution is http://www.codechef.com/viewsolution/2713870.
For a fraction a/b, the largest fraction which can be subtracted is 1/ceil(b/a).(Greedy approach)
The new fraction a’/b’=(kXa-b)/(kXb)
Am I wrong with this approach?