401917: GYM100574 D Valentine's Cake
Memory Limit:64 MB
Time Limit:1 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
D. Valentine's Caketime limit per test1 secondmemory limit per test64 megabytesinputstandard inputoutputstandard output
Rasta has bought a cake for valentine's day. He knows that his love, Rosita loves number a and he, himself loves number b. So he want to cut the cake into c pieces where c is the greatest number that a and b are both multiplies of c .
Your task is to write a program with language DIT, and storages a b 0 0 calculates number c and put it in storage number 1 (the other storages don't matter).
Your program's order mustn't exceed 2 * 107 .
InputThe numbers in the storages are a b 0 0 in order.
1 ≤ a, b ≤ 105
Outputc should be in the first storage.
ExamplesInput1 5 0 0Output
1Input
6 8 0 0Output
2