next up previous
Next: Sample Input Up: Fractions Previous: Input

Output

The output consists of n lines for the n cases. Each line has two integers, separated by a space (let them be x and y), such that:
displaymath129
where tex2html_wrap_inline139 is the operation indicated by a. The fraction tex2html_wrap_inline143 must be in the most reduced form. For example, for the fraction tex2html_wrap_inline145, its most reduced form is tex2html_wrap_inline147; for tex2html_wrap_inline149, it would be tex2html_wrap_inline151. If the resulting fraction is negative, put the negative sign in x. You may assume that there is no division by zero, and all integers are between -2,000,000,000 and 2,000,000,000.



ACM Programming Contest Account
Mon Feb 5 17:30:22 EST 2001