SP26346 NINJA3 - STUNNING GCD

Description

**Problem statement:** You are given three numbers N, a, b. You can build a number X by repeating N 'a' times and the number Y by repeating N 'b' times. Now that you have the numbers X and Y, determine the GCD of the two numbers X and Y. **Input format:** The first line contains an integer T, the number of test cases. Then for each test case, there are three integers in each line: **N, a, b**. **Output format:** Print the required answer for each test case in a single line. **Constraints:** **1

Input Format

N/A

Output Format

N/A