Problem hidden
This problem was hidden by Editorial Board member probably because it has incorrect language version or invalid test data, or description of the problem is not clear.

Problem hidden on 2014-06-23 09:30:15 by Francky

SNGFRAC1 - Adding Two Fractions

no tags 

Given two fractions, just add them. Too Easy :)

The fractions are represented either as p/q or p such that q >= 1. Now let p1/q1 and p2/q2 be the given fractions, then the sum of the fractions will either be P/Q or P (that allows the fraction to be in irreducible form).

The fraction given as p is equal to p/1.

Input

The first line of input is T, (total no. of test cases). Next T lines contains two space separated fractions.

Output

Print the sum of two fractions (must be in irreducible form) in most appropriate format in each line.

Example

Input:
5
1/2 1/3
2 -1/2
2/4 4/8
-1/7 1/11
-21/7 -31/1

Output:
5/6
3/2
1
-4/77
-34

Constraints

T <= 10000
-109 <= p <= 109
1 <= q <= 109

Irreducible Fraction

The fraction p/q is said to be in irreducible form if greatest common divisor of "p" and "q" is 1.


hide comments
AvmnuSng: 2014-06-22 12:02:55

@Mitch : I will surely take care of it and one last thing, if you say I can allow all the languages for submission but without compromising with the initially set time limits for test cases.

And there will be no rejudging for sure.

Last edit: 2014-06-21 11:00:42
Mitch Schwartz: 2014-06-22 12:02:55

I don't really see the logic of restricting to those particular languages, but at some point I run out of energy to make arguments and reach an agreement when there are seemingly incompatible viewpoints. I seem to have solved it in an acceptable way now (until the next rejudge...), and anyway I've made the problem visible again (in classical section). Please try to be more careful when setting new problems, to avoid inconveniences on all ends. Thank you.

Mitch Schwartz: 2014-06-22 12:02:55

There are some other issues as well. The problem is not fair for slower languages, and my guess is that you did this intentionally to exclude languages that have certain built-in features that would make the problem quite trivial. (Maybe my initial submission had something to do with this?) A more direct approach seems better: only allow some languages. You can see e.g. GCD4 where there is a justified language restriction.

Last edit: 2014-06-21 00:17:58
AvmnuSng: 2014-06-22 12:02:55

I understand that rejudge is rare and must be done with proper notice, but there were just two users submitted so I rejudged the submissions and the reason for rejudge is just the extra test cases I was adding, as I told you earlier.

Mitch Schwartz: 2014-06-22 12:02:55

It's very simple. When you publish a problem, you are inviting other users to spend their time working on it. They may do so, with the general intent of getting a favorable judge result. If they succeed, they will tend to get a sense of satisfaction, to varying degrees. Changing the problem after people have already spent time on it can cause a feeling that is somewhat opposite to satisfaction.

Rejudges should be rare, and proper notice should be given, because it indicates that there is something that you, as problem setter, neglected to take care of *before* publishing.

Doing a rejudge within hours of publishing the problem and receiving the first submissions, and without giving any notice, IS a sign of incompetence, although there are more polite (indirect, dodgy) ways to say it. Maybe it is a fair exchange if my comment gave you a feeling of dissatisfaction similar to the feeling you imposed on the first solvers.

Last edit: 2014-06-20 23:45:18
AvmnuSng: 2014-06-22 12:02:55

@Mitch : The rejudge was done because I was adding test cases. and now I am done... So I hope you will allow submissions for the problem now.

Last edit: 2014-06-20 23:31:36
Mitch Schwartz: 2014-06-22 12:02:55

Problem hidden because problem setter is incompetent.

(It does not mean that the problem is permanently hidden -- but since there has already been a rejudge that makes some AC solutions get WA and others get TLE, it is better to hide it until the problem setter can demonstrate competence; users should not have to suffer for that.)

Last edit: 2014-06-20 23:02:59

Added by:AvmnuSng
Date:2014-06-20
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All
Resource:Abhimanyu Singh
My Problems