fork download
  1. #include <iostream>
  2. #include <cstdlib>
  3.  
  4. using namespace std;
  5. int p;
  6. int l1, l2, iloczyn;
  7. int main()
  8. {
  9.  
  10.  
  11. cin>>p;
  12.  
  13. for(int i=1; i<=p; i++)
  14. {
  15.  
  16. cin >> l1;
  17. cin >> l2;
  18.  
  19. iloczyn = l1*l2;
  20.  
  21. do
  22. {
  23. if(l1>l2) l1=l1-l2;
  24. else l2=l2-l1;
  25. }
  26. while(l1!=l2);
  27.  
  28. cout << iloczyn/l1<<endl;
  29. }
  30. return 0;
  31. }
  32.  
Success #stdin #stdout 0s 16064KB
stdin
2 
12 15
11 22
stdout
60
22