Created
July 30, 2013 04:46
-
-
Save swapnil-warke/6110307 to your computer and use it in GitHub Desktop.
UVA 11388 GCD LCM
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #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