Fun With Fraction

Limits 10s, 512 MB

Dulal is a school going kid. He is learning basic math right now. Today he has learned about division and fraction. His teacher has assigned few homeworks on it. In the assignment, the teacher will provide few pair of integers representing the numerator and denominator of a fraction and Dulal needs to print the fraction in string format. If the fractional part is repeating, he needs to enclose the repeating part in parentheses. Can you help Dulal to prepare his homework?

This is a companion discussion topic for the original entry at