Masala #INB9WKTXVX

Xotira 32 MB Vaqt 1000 ms
14

Mathematics 1

Write a program that generates a series of fraction simplification problems. Each problem consists of a fraction in the form a/b, where a and b are randomly generated positive integers between 1 and 1000.

Your task is to simplify each fraction to its simplest form by dividing both the numerator and the denominator by their greatest common divisor (GCD).

Write a Python program that generates 100 fraction simplification problems.

The output file should contain a single line with the simplified fraction in the form c/d, where c and d are the numerator and denominator of the simplified fraction obtained by dividing a and b by their GCD.

Ensure that the generated fractions are in their simplest form, i.e., the GCD of a and b is 1.


Kiruvchi ma'lumotlar:

The input file should contain a single line with the fraction in the form a/b.


Chiquvchi ma'lumotlar:

The output file should contain a single line with the simplified fraction in the form c/d, where c and d are the numerator and denominator of the simplified fraction obtained by dividing a and b by their GCD.

Ensure that the generated fractions are in their simplest form, i.e., the GCD of a and b is 1.


Misollar
# input.txt output.txt
1
341/788
341/788
2
774/947
774/947