Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int ile, a, b, m, r1, r2;
- int main()
- {
- cin>>ile;
- for(int i=0; i<ile; i++)
- {
- cin>>a>>b;
- if(a>b) m=a;
- else m=b;
- do
- {
- r1=m%a;
- r2=m%b;
- m++;
- }
- while((r1==0) && (r2==0));
- cout<<m;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement