Ad
  • Custom User Avatar

    I believe there should be some fallacies in test cases since the description require a minimum D.
    Other than the case raised by tchar. Also there can be test case like:
    [[2/4]]
    which should generate this output:
    [[1/2]]

    Maybe the author could modify the problem description so that solvers are required to put the l.c.m. as the denominator.

  • Custom User Avatar

    Agreed. This solution is indeed clean and nicely organized. However if performance is to be considered, this solution is not as good as others are.