#C5435. Simplify the Fraction
Simplify the Fraction
Simplify the Fraction
Given two integers \(a\) and \(b\) that represent the numerator and denominator of a fraction, your task is to simplify the fraction to its lowest terms. The simplified fraction is obtained by dividing both the numerator and denominator by their greatest common divisor (GCD). The answer should be provided in the form \(a/b\), where \(a\) and \(b\) are integers and \(b > 0\).
Note: If the fraction is already in its simplest form, then it should be output without any changes. You may assume that \(b \neq 0\).
The mathematical expression for the simplification is given by:
[ \frac{a}{b} = \frac{a \div \gcd(a, b)}{b \div \gcd(a, b)} ]
inputFormat
The input consists of a single line containing two space-separated integers \(a\) and \(b\) where:
- \(a\) is the numerator.
- \(b\) is the denominator (\(b \neq 0\)).
outputFormat
Output a single line containing the simplified fraction in the form \(a/b\).
## sample8 12
2/3