fork(1) download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int a,b,t,c;
  6.  
  7. int main()
  8. {
  9. cin>>t;
  10. for (int i=0;i<t;i++)
  11. {
  12. cin>>a>>b;
  13. int n=10;
  14. if((a%b!=0)&&(b%a!=0))
  15. {
  16. do
  17. {
  18.  
  19. n-=1;
  20. c=(a*b)/n;
  21. } while((c%a>0)||(c%b>0));
  22. cout<<c<<endl;
  23. }
  24. else if (a>b) cout<<a<<endl;
  25. else if (b>a) cout<<b<<endl;
  26. }
  27.  
  28. return 0;
  29. }
  30.  
Success #stdin #stdout 0s 4140KB
stdin
Standard input is empty
stdout
Standard output is empty