Skip to content

Instantly share code, notes, and snippets.

@swapnil-warke
Created July 30, 2013 04:46
Show Gist options
  • Select an option

  • Save swapnil-warke/6110307 to your computer and use it in GitHub Desktop.

Select an option

Save swapnil-warke/6110307 to your computer and use it in GitHub Desktop.
UVA 11388 GCD LCM
#include <stdio.h>
int main()
{
int n;
scanf("%d",&n);
while(n--)
{
int a,b;
scanf("%d %d",&a,&b);
if(b%a==0)
printf("%d %d\n",a,b);
else
printf("-1\n");
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment