Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #define ullong unsigned long long int
- #define true 1
- #define false 0
- int main(int argc, char ** argv){
- ullong a, b, ta, tb, c, d;
- while(true){
- scanf("%llu %llu", &a, &b);
- if(a==0) break;
- //printf("l");
- ta=a;tb=b;
- while(b!=a){
- //printf("=%llu %llu\n", a, b);
- if(a<b)a+=ta;
- else b+=tb;
- }
- printf("%llu\n", (a/ta)*(b/tb));
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment