Guest User

Untitled

a guest
May 24th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.42 KB | None | 0 0
  1. #include <stdio.h>
  2. #define ullong unsigned long long int
  3. #define true 1
  4. #define false 0
  5. int main(int argc, char ** argv){
  6.   ullong a, b, ta, tb, c, d;
  7.   while(true){
  8.     scanf("%llu %llu", &a, &b);
  9.     if(a==0) break;
  10.     //printf("l");
  11.     ta=a;tb=b;
  12.     while(b!=a){
  13.       //printf("=%llu %llu\n", a, b);
  14.       if(a<b)a+=ta;
  15.       else b+=tb;
  16.     }
  17.     printf("%llu\n", (a/ta)*(b/tb));
  18.   }
  19.   return 0;
  20. }
Add Comment
Please, Sign In to add comment