I'm getting TLE forr this problem can't understand why.I think there is some special cases.Because I solve problem 834 and my program is giving right answers for this kind of tests.
Input
Code: Select all
-5 7
34 -64
9 -5
-33 -57
123456789123456789 987654321
55555555555555555555 66666666666666666666
Code: Select all
-5/7=-1+1/{3+1/{2}}
34/-64=-1+1/{2+1/{7+1/{2}}}
9/-5=-2+1/{5}
-33/-57=0+1/{1+1/{1+1/{2+1/{1+1/{2}}}}}
123456789123456789/987654321=124999998+1/{1+1/{70+1/{9+1/{2170+1/{2+1/{1+1/{2+1/{1+1/{1+1/{1+1/{2}}}}}}}}}}}
55555555555555555555/66666666666666666666=0+1/{1+1/{5}}
Thanks.