UVA 11388 - GCD LCM

UVA Sep 1, 2020

Problem PDF

Solution:

#include
int main()
{
int n,m,t;
scanf("%d",&t);
while(t--)
{
    scanf("%d%d",&m,&n);
    if(n%m==0)
    printf("%d %d\n",m,n);
    else
    printf("-1\n");
}
return 0;
}


https://github.com/Shipu/OnlineJudgeProblemSolutionWithCPlusPlus/tree/master/uva/11388/11388.cpp

Tags

Great! You've successfully subscribed.
Great! Next, complete checkout for full access.
Welcome back! You've successfully signed in.
Success! Your account is fully activated, you now have access to all content.